From aa00ebefef9ac79b43b8988ab2a0fb2bb698068a Mon Sep 17 00:00:00 2001 From: Pierre Tachoire Date: Wed, 6 Nov 2024 14:21:26 +0100 Subject: [PATCH 1/5] ical: export the 50 last events --- themes/hyde-custom/layouts/_default/home.calendar.ics | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/themes/hyde-custom/layouts/_default/home.calendar.ics b/themes/hyde-custom/layouts/_default/home.calendar.ics index 8e74762..51ee087 100644 --- a/themes/hyde-custom/layouts/_default/home.calendar.ics +++ b/themes/hyde-custom/layouts/_default/home.calendar.ics @@ -1,7 +1,8 @@ BEGIN:VCALENDAR PRODID:planet.clermontech.org VERSION:2.0 -{{ range first 5 (sort .Site.RegularPages ".Params.event.date" "desc") }} +{{ range first 50 (sort .Site.RegularPages ".Params.event.date" "desc") }} + BEGIN:VEVENT UID:{{ base64Encode .Params.event.Date }} DTSTART;TZID=Europe/Paris:{{ time.Format "20060102T150405" .Params.event.Date }} From 1c4c1ee78919ae3c0b67ab665cd6788bea4d3203 Mon Sep 17 00:00:00 2001 From: Pierre Tachoire Date: Wed, 6 Nov 2024 14:21:50 +0100 Subject: [PATCH 2/5] ical: use permalink as UID --- themes/hyde-custom/layouts/_default/home.calendar.ics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/hyde-custom/layouts/_default/home.calendar.ics b/themes/hyde-custom/layouts/_default/home.calendar.ics index 51ee087..403f5af 100644 --- a/themes/hyde-custom/layouts/_default/home.calendar.ics +++ b/themes/hyde-custom/layouts/_default/home.calendar.ics @@ -4,7 +4,7 @@ VERSION:2.0 {{ range first 50 (sort .Site.RegularPages ".Params.event.date" "desc") }} BEGIN:VEVENT -UID:{{ base64Encode .Params.event.Date }} +UID:{{ base64Encode .Permalink }} DTSTART;TZID=Europe/Paris:{{ time.Format "20060102T150405" .Params.event.Date }} DTEND;TZID=Europe/Paris:{{ time.Format "20060102T150405" ((time.AsTime .Params.event.Date).Add (time.ParseDuration "1h")) }} SUMMARY:{{ .Params.event.name }} From 5a44b91d441831ebea7b1a1ebbf3f2633cd38aa1 Mon Sep 17 00:00:00 2001 From: Pierre Tachoire Date: Wed, 6 Nov 2024 14:22:09 +0100 Subject: [PATCH 3/5] ical: add ORGANIZER --- themes/hyde-custom/layouts/_default/home.calendar.ics | 1 + 1 file changed, 1 insertion(+) diff --git a/themes/hyde-custom/layouts/_default/home.calendar.ics b/themes/hyde-custom/layouts/_default/home.calendar.ics index 403f5af..0dca073 100644 --- a/themes/hyde-custom/layouts/_default/home.calendar.ics +++ b/themes/hyde-custom/layouts/_default/home.calendar.ics @@ -7,6 +7,7 @@ BEGIN:VEVENT UID:{{ base64Encode .Permalink }} DTSTART;TZID=Europe/Paris:{{ time.Format "20060102T150405" .Params.event.Date }} DTEND;TZID=Europe/Paris:{{ time.Format "20060102T150405" ((time.AsTime .Params.event.Date).Add (time.ParseDuration "1h")) }} +ORGANIZER:{{ .Params.organizer.name }} SUMMARY:{{ .Params.event.name }} LOCATION:{{ .Params.event.location.full_address }} DESCRIPTION: {{ replace .RawContent "\n" "" }} From 3d2c5536c77467f2720c176e031c0f82aecdbd2f Mon Sep 17 00:00:00 2001 From: Pierre Tachoire Date: Wed, 6 Nov 2024 14:22:59 +0100 Subject: [PATCH 4/5] ical: better location and remove categories --- themes/hyde-custom/layouts/_default/home.calendar.ics | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/themes/hyde-custom/layouts/_default/home.calendar.ics b/themes/hyde-custom/layouts/_default/home.calendar.ics index 0dca073..6024ec5 100644 --- a/themes/hyde-custom/layouts/_default/home.calendar.ics +++ b/themes/hyde-custom/layouts/_default/home.calendar.ics @@ -9,9 +9,8 @@ DTSTART;TZID=Europe/Paris:{{ time.Format "20060102T150405" .Params.event.Date }} DTEND;TZID=Europe/Paris:{{ time.Format "20060102T150405" ((time.AsTime .Params.event.Date).Add (time.ParseDuration "1h")) }} ORGANIZER:{{ .Params.organizer.name }} SUMMARY:{{ .Params.event.name }} -LOCATION:{{ .Params.event.location.full_address }} -DESCRIPTION: {{ replace .RawContent "\n" "" }} -CATEGORIES: {{ range .Params.tags }} {{ . }} {{- end}} +LOCATION:{{ .Params.event.location.friendly_name }} {{ .Params.event.location.full_address }} +DESCRIPTION:{{ replace .RawContent "\n" " " | replaceRE " +" " " }} END:VEVENT {{- end }} END:VCALENDAR \ No newline at end of file From cd558e9e589c5f7ff68debb6316725157736bcae Mon Sep 17 00:00:00 2001 From: Pierre Tachoire Date: Wed, 6 Nov 2024 14:24:07 +0100 Subject: [PATCH 5/5] ical: add URL --- themes/hyde-custom/layouts/_default/home.calendar.ics | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/themes/hyde-custom/layouts/_default/home.calendar.ics b/themes/hyde-custom/layouts/_default/home.calendar.ics index 6024ec5..a556d56 100644 --- a/themes/hyde-custom/layouts/_default/home.calendar.ics +++ b/themes/hyde-custom/layouts/_default/home.calendar.ics @@ -11,6 +11,7 @@ ORGANIZER:{{ .Params.organizer.name }} SUMMARY:{{ .Params.event.name }} LOCATION:{{ .Params.event.location.friendly_name }} {{ .Params.event.location.full_address }} DESCRIPTION:{{ replace .RawContent "\n" " " | replaceRE " +" " " }} +URL:{{ .Params.event.event_url}} END:VEVENT {{- end }} -END:VCALENDAR \ No newline at end of file +END:VCALENDAR