Skip to content

Commit

Permalink
skip events older than 356 days
Browse files Browse the repository at this point in the history
  • Loading branch information
teuserer committed Apr 1, 2024
1 parent ab7f484 commit 734dc17
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions _plugins/events_to_ics.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ def generate(site)
organizer = event.data.dig('event', 'organizer') || default_organizer
location = event.data.dig('event', 'location') || default_location

# Skip events older than 365 days
next if start_date.to_date < (Date.today - 365)

# Remove image URLs from description
content = event.content
content.gsub!(/\!\[.*?\]\((.*?)\)/, '')
Expand Down

0 comments on commit 734dc17

Please sign in to comment.