Skip to content

Commit

Permalink
Merge pull request #127 from netz39/feat/events/skip
Browse files Browse the repository at this point in the history
feat/skip events older than 365 days
  • Loading branch information
MG-5 authored Apr 10, 2024
2 parents 9ef4d51 + 734dc17 commit ab9afb2
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 ab9afb2

Please sign in to comment.