From 734dc1798f3c9a6cff252c9db7a26ccf0d2daa73 Mon Sep 17 00:00:00 2001 From: teuserer Date: Mon, 1 Apr 2024 22:28:35 +0200 Subject: [PATCH] skip events older than 356 days --- _plugins/events_to_ics.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/_plugins/events_to_ics.rb b/_plugins/events_to_ics.rb index 9757b60..9d4c3cf 100644 --- a/_plugins/events_to_ics.rb +++ b/_plugins/events_to_ics.rb @@ -21,6 +21,9 @@ module Jekyll 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!(/\!\[.*?\]\((.*?)\)/, '')