From 63b3b99ffffbeae84493e6ef9d5680db5dfa1bf8 Mon Sep 17 00:00:00 2001 From: Lino Date: Sun, 21 Apr 2024 05:47:41 +0200 Subject: [PATCH 01/29] feat(calendar): init calendar --- content/events/test.de.md | 11 +++++++++++ content/events/test.en.md | 11 +++++++++++ layouts/events/list.ics | 20 ++++++++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 content/events/test.de.md create mode 100644 content/events/test.en.md create mode 100644 layouts/events/list.ics diff --git a/content/events/test.de.md b/content/events/test.de.md new file mode 100644 index 0000000..c515c8d --- /dev/null +++ b/content/events/test.de.md @@ -0,0 +1,11 @@ +--- +title: "Test DE" +talk: "Blub DE" +date: "2024-04-20T19:22:00Z" +slot: + start: "2024-04-28T15:00:00-06:00" + end: "2024-04-29T15:20:00-06:00" +url: /events.ics +--- + +Lalala diff --git a/content/events/test.en.md b/content/events/test.en.md new file mode 100644 index 0000000..913edd9 --- /dev/null +++ b/content/events/test.en.md @@ -0,0 +1,11 @@ +--- +title: "Test EN" +talk: "Blub EN" +date: "2024-04-20T19:22:00Z" +slot: + start: "2024-04-28T15:00:00-06:00" + end: "2024-04-29T15:20:00-06:00" +url: /events.ics +--- + +Lalala diff --git a/layouts/events/list.ics b/layouts/events/list.ics new file mode 100644 index 0000000..7edfe31 --- /dev/null +++ b/layouts/events/list.ics @@ -0,0 +1,20 @@ +BEGIN:VCALENDAR +VERSION:2.0 +PRODID:-//elm-conf//speaker calendar//EN +CALSCALE:GREGORIAN +METHOD:PUBLISH +{{range .Pages -}} +BEGIN:VEVENT +ORGANIZER;CN="Brian Hicks":mailto:brian@brianthicks.com +SUMMARY:{{.Title}}{{with .Params.talk}} – {{.}}{{end}} +UID:{{.Params.slot.start}}@2017.elm-conf.us +SEQUENCE:0 +STATUS:CONFIRMED +DTSTAMP:{{dateFormat "20060102T150405Z" .Date}} +DTSTART;TZID=America/Chicago:{{dateFormat "20060102T150405" .Params.slot.start}} +DTEND;TZID=America/Chicago:{{dateFormat "20060102T150405" .Params.slot.end}} +LOCATION:{{with .Params.location}}{{.}}{{else}}Main Ballroom{{end}} +URL:{{.Permalink}} +END:VEVENT +{{end -}} +END:VCALENDAR \ No newline at end of file From 07f6288cd29938a676013ec6bf78863c6450dfd4 Mon Sep 17 00:00:00 2001 From: noxil Date: Tue, 16 Jul 2024 22:24:17 +0200 Subject: [PATCH 02/29] feat(calendar): finetune ical and add html page for events --- content/events/test.de.md | 15 +++++++-------- content/events/test.en.md | 11 ----------- layouts/events/list.ics | 26 +++++++++++++++----------- layouts/events/single.html | 33 +++++++++++++++++++++++++++++++++ 4 files changed, 55 insertions(+), 30 deletions(-) delete mode 100644 content/events/test.en.md create mode 100644 layouts/events/single.html diff --git a/content/events/test.de.md b/content/events/test.de.md index c515c8d..7098db1 100644 --- a/content/events/test.de.md +++ b/content/events/test.de.md @@ -1,11 +1,10 @@ --- -title: "Test DE" -talk: "Blub DE" -date: "2024-04-20T19:22:00Z" -slot: - start: "2024-04-28T15:00:00-06:00" - end: "2024-04-29T15:20:00-06:00" -url: /events.ics +title: "Freifunk Stammtisch" +start: "2024-04-28T15:00:00-06:00" +end: "2024-04-29T15:20:00-06:00" +repeat: "FREQ=MONTHLY;INTERVAL=1;BYDAY=3TU" +location: "c-base, Rungestraße 161" +category: "Community" --- -Lalala +Tired of scrolling through the same posts? When you create an account you’ll always come back to where you left off. With an account you can also be notified of new replies, save bookmarks, and use likes to thank others. We can all work together to make this community great. Tired of scrolling through the same posts? When you create an account you’ll always come back to where you left off. With an account you can also be notified of new replies, save bookmarks, and use likes to thank others. We can all work together to make this community great. \ No newline at end of file diff --git a/content/events/test.en.md b/content/events/test.en.md deleted file mode 100644 index 913edd9..0000000 --- a/content/events/test.en.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: "Test EN" -talk: "Blub EN" -date: "2024-04-20T19:22:00Z" -slot: - start: "2024-04-28T15:00:00-06:00" - end: "2024-04-29T15:20:00-06:00" -url: /events.ics ---- - -Lalala diff --git a/layouts/events/list.ics b/layouts/events/list.ics index 7edfe31..2b99db2 100644 --- a/layouts/events/list.ics +++ b/layouts/events/list.ics @@ -1,20 +1,24 @@ BEGIN:VCALENDAR VERSION:2.0 -PRODID:-//elm-conf//speaker calendar//EN +PRODID:-//freifunk berlin//hugo wegbsite generator//EN CALSCALE:GREGORIAN -METHOD:PUBLISH {{range .Pages -}} BEGIN:VEVENT -ORGANIZER;CN="Brian Hicks":mailto:brian@brianthicks.com -SUMMARY:{{.Title}}{{with .Params.talk}} – {{.}}{{end}} -UID:{{.Params.slot.start}}@2017.elm-conf.us -SEQUENCE:0 -STATUS:CONFIRMED DTSTAMP:{{dateFormat "20060102T150405Z" .Date}} -DTSTART;TZID=America/Chicago:{{dateFormat "20060102T150405" .Params.slot.start}} -DTEND;TZID=America/Chicago:{{dateFormat "20060102T150405" .Params.slot.end}} -LOCATION:{{with .Params.location}}{{.}}{{else}}Main Ballroom{{end}} +LOCATION:{{.Params.location}} +CATEGORIES:{{.Params.category}} +SEQUENCE:0 +SUMMARY:{{.Title}} +DESCRIPTION:{{.RawContent}} +UID:{{.Params.start}}@berlin.freifunk.net +DTSTART;TZID=Europe/Berlin:{{dateFormat "20060102T150405" .Params.start}} +{{with .Params.end}} +DTEND;TZID=Europe/Berlin:{{dateFormat "20060102T150405" .}} +{{end}} +{{with .Params.repeat}} +RRULE:{{.}} +{{end}} URL:{{.Permalink}} END:VEVENT {{end -}} -END:VCALENDAR \ No newline at end of file +END:VCALENDAR diff --git a/layouts/events/single.html b/layouts/events/single.html new file mode 100644 index 0000000..010c892 --- /dev/null +++ b/layouts/events/single.html @@ -0,0 +1,33 @@ +{{ define "main" }} +
+
+

{{ .Title }} ({{ time.Format "January 2, 2006" .Params.start }})

+
+
+

{{ .Content | markdownify }}

+
+
+ + + event +

+ location_on{{ .Params.location }} +

+ {{ if .Params.repeat }} +

+ event_repeatEvent happens regularly +

+ {{ end }} +

+ schedule{{ time.Format "2 Jan 2006 15:04" .Params.start }} +
+ - {{ time.Format "2 Jan 2006 15:04" .Params.end }} +

+

+ sell{{ .Params.category }} +

+
+
+
+
+{{ end }} From deefc68a5862d195eac5e2337972c45ea5874f7e Mon Sep 17 00:00:00 2001 From: noxil Date: Wed, 17 Jul 2024 02:11:27 +0200 Subject: [PATCH 03/29] chore(calendar): extra page for events --- content/events.de.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 content/events.de.md diff --git a/content/events.de.md b/content/events.de.md new file mode 100644 index 0000000..bd78a6a --- /dev/null +++ b/content/events.de.md @@ -0,0 +1,32 @@ +--- +title: "Events" +url: "events" +--- + + + +
\ No newline at end of file From 336052b428c7e98a3ef592c934c384b2fe951104 Mon Sep 17 00:00:00 2001 From: noxil Date: Wed, 17 Jul 2024 02:13:27 +0200 Subject: [PATCH 04/29] chore(calendar): add freifunk meeting event --- content/events/freifunktreffen.de.md | 12 ++++++++++++ content/events/test.de.md | 10 ---------- 2 files changed, 12 insertions(+), 10 deletions(-) create mode 100644 content/events/freifunktreffen.de.md delete mode 100644 content/events/test.de.md diff --git a/content/events/freifunktreffen.de.md b/content/events/freifunktreffen.de.md new file mode 100644 index 0000000..2b8a5a6 --- /dev/null +++ b/content/events/freifunktreffen.de.md @@ -0,0 +1,12 @@ +--- +title: "Freifunktreffen auf der c-base" +start: "2024-07-03T20:00:00" +end: "2024-07-03T15:23:00" +location: "Rungestraße 20, 10179 Berlin" +category: "Community" +--- + +Hier kannst du viele andere Freifunkende treffen und Kontakte schließen. Wir nutzen dieses Treffen, um Community-Themen zu besprechen und bei einem leckeren Getränk eine schöne Zeit zu haben. Die [c-base](https://www.openstreetmap.org/?mlat=52.51297&mlon=13.42011#map=17/52.51297/13.42011) ist an der Spree, ganz in der Nähe vom Bahnhof Jannowitzbrücke. + +Du möchtest ein Thema vorschlagen, dass wir als Community besprechen sollten? Schicke deinen Themenvorschlag über die Mailingliste. Komm gerne einfach vorbei, wir freuen uns immer über neue Menschen. + diff --git a/content/events/test.de.md b/content/events/test.de.md deleted file mode 100644 index 7098db1..0000000 --- a/content/events/test.de.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: "Freifunk Stammtisch" -start: "2024-04-28T15:00:00-06:00" -end: "2024-04-29T15:20:00-06:00" -repeat: "FREQ=MONTHLY;INTERVAL=1;BYDAY=3TU" -location: "c-base, Rungestraße 161" -category: "Community" ---- - -Tired of scrolling through the same posts? When you create an account you’ll always come back to where you left off. With an account you can also be notified of new replies, save bookmarks, and use likes to thank others. We can all work together to make this community great. Tired of scrolling through the same posts? When you create an account you’ll always come back to where you left off. With an account you can also be notified of new replies, save bookmarks, and use likes to thank others. We can all work together to make this community great. \ No newline at end of file From 12d11a10637e0e38d3bef6645eda9aac9cb3d884 Mon Sep 17 00:00:00 2001 From: noxil Date: Wed, 17 Jul 2024 02:14:25 +0200 Subject: [PATCH 05/29] chore(calendar): simplif ical --- layouts/events/list.ics | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/layouts/events/list.ics b/layouts/events/list.ics index 2b99db2..109d5bb 100644 --- a/layouts/events/list.ics +++ b/layouts/events/list.ics @@ -4,20 +4,18 @@ PRODID:-//freifunk berlin//hugo wegbsite generator//EN CALSCALE:GREGORIAN {{range .Pages -}} BEGIN:VEVENT -DTSTAMP:{{dateFormat "20060102T150405Z" .Date}} -LOCATION:{{.Params.location}} -CATEGORIES:{{.Params.category}} +DTSTAMP;VALUE=DATE-TIME:{{ dateFormat "20060102T150405Z" .Date }} +LOCATION:{{ .Params.location }} +CATEGORIES:{{ .Params.category }} SEQUENCE:0 -SUMMARY:{{.Title}} -DESCRIPTION:{{.RawContent}} +CLASS:PUBLIC +SUMMARY:{{ .Title }} +{{ $description := .Content | plainify }} +{{ $description := replace $description "\n" "=0D=0A" }} +DESCRIPTION;ENCODING=QUOTED-PRINTABLE:{{ $description }} UID:{{.Params.start}}@berlin.freifunk.net -DTSTART;TZID=Europe/Berlin:{{dateFormat "20060102T150405" .Params.start}} -{{with .Params.end}} -DTEND;TZID=Europe/Berlin:{{dateFormat "20060102T150405" .}} -{{end}} -{{with .Params.repeat}} -RRULE:{{.}} -{{end}} +DTSTART;TZID=Europe/Berlin;VALUE=DATE-TIME:{{dateFormat "20060102T150405" .Params.start}} +DTEND;TZID=Europe/Berlin;VALUE=DATE-TIME:{{dateFormat "20060102T150405" .Params.end}} URL:{{.Permalink}} END:VEVENT {{end -}} From bb76f969757067c74fbe913b0e835ebe3aeb1671 Mon Sep 17 00:00:00 2001 From: noxil Date: Wed, 17 Jul 2024 02:14:51 +0200 Subject: [PATCH 06/29] feat(calendar): style html representation --- layouts/events/single.html | 48 ++++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/layouts/events/single.html b/layouts/events/single.html index 010c892..ad0cd72 100644 --- a/layouts/events/single.html +++ b/layouts/events/single.html @@ -1,31 +1,33 @@ {{ define "main" }}
-

{{ .Title }} ({{ time.Format "January 2, 2006" .Params.start }})

+

+ calendar_month {{ .Title }} {{ time.Format "02 Jan 2006" .Params.start }} +

-
-

{{ .Content | markdownify }}

+
+

{{ .Content | markdownify }}

-
- - - event -

- location_on{{ .Params.location }} -

- {{ if .Params.repeat }} -

- event_repeatEvent happens regularly -

- {{ end }} -

- schedule{{ time.Format "2 Jan 2006 15:04" .Params.start }} -
- - {{ time.Format "2 Jan 2006 15:04" .Params.end }} -

-

- sell{{ .Params.category }} -

+
+
+ location_on +

{{ .Params.location }}

+
+
+ schedule +

+ {{ time.Format "2 Jan 2006 15:04" .Params.start }} +
+ - {{ time.Format "2 Jan 2006 15:04" .Params.end }} +

+
+
+ sell +

{{ .Params.category }}

+
From 578ed3741608d19b52251bf2276fc1f38c21a875 Mon Sep 17 00:00:00 2001 From: noxil Date: Tue, 20 Aug 2024 02:24:05 +0200 Subject: [PATCH 07/29] fix(calendar): load font for icons --- content/events.de.md | 1 - hugo.toml | 3 +++ layouts/events/list.ics | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/content/events.de.md b/content/events.de.md index bd78a6a..09cb0f3 100644 --- a/content/events.de.md +++ b/content/events.de.md @@ -1,6 +1,5 @@ --- title: "Events" -url: "events" --- - -
\ No newline at end of file diff --git a/content/events/_index.de.md b/content/events/_index.de.md new file mode 100644 index 0000000..46bf406 --- /dev/null +++ b/content/events/_index.de.md @@ -0,0 +1,4 @@ +--- +title: "Events" +calendars: ["index.ics", "https://www.c-base.org/calendar/exported/regulars.ics"] +--- diff --git a/layouts/events/list.html b/layouts/events/list.html new file mode 100644 index 0000000..7cfe15d --- /dev/null +++ b/layouts/events/list.html @@ -0,0 +1,42 @@ +{{ define "main" }} +
+
+ + +
+ ical Feed +
+
+{{ end }} From cf2d257d8369e275ac39520bacdf0c4b693cc8eb Mon Sep 17 00:00:00 2001 From: noxil Date: Wed, 28 Aug 2024 00:54:03 +0200 Subject: [PATCH 09/29] content(event): add freifunk meetup --- content/events/freifunktreffen.de.md | 2 +- content/events/freifunktreffen.en.md | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 content/events/freifunktreffen.en.md diff --git a/content/events/freifunktreffen.de.md b/content/events/freifunktreffen.de.md index 2b8a5a6..2313f51 100644 --- a/content/events/freifunktreffen.de.md +++ b/content/events/freifunktreffen.de.md @@ -2,8 +2,8 @@ title: "Freifunktreffen auf der c-base" start: "2024-07-03T20:00:00" end: "2024-07-03T15:23:00" +rrule: "FREQ=MONTHLY;INTERVAL=1;BYDAY=1WE" location: "Rungestraße 20, 10179 Berlin" -category: "Community" --- Hier kannst du viele andere Freifunkende treffen und Kontakte schließen. Wir nutzen dieses Treffen, um Community-Themen zu besprechen und bei einem leckeren Getränk eine schöne Zeit zu haben. Die [c-base](https://www.openstreetmap.org/?mlat=52.51297&mlon=13.42011#map=17/52.51297/13.42011) ist an der Spree, ganz in der Nähe vom Bahnhof Jannowitzbrücke. diff --git a/content/events/freifunktreffen.en.md b/content/events/freifunktreffen.en.md new file mode 100644 index 0000000..bf50a13 --- /dev/null +++ b/content/events/freifunktreffen.en.md @@ -0,0 +1,11 @@ +--- +title: "Freifunk meet up on the c-base" +start: "2024-07-03T20:00:00" +end: "2024-07-03T15:23:00" +rrule: "FREQ=MONTHLY;INTERVAL=1;BYDAY=1WE" +location: "Rungestraße 20, 10179 Berlin" +--- + +Here you can meet many other Freifunkers and make new contacts. We use this meeting to discuss community topics and have a good time over a delicious drink. The [c-base](https://www.openstreetmap.org/?mlat=52.51297&mlon=13.42011#map=17/52.51297/13.42011) is on the Spree, very close to Jannowitzbrücke station. + +Would you like to suggest a topic that we should discuss as a community? Send your topic suggestion via the mailing list. Just drop by, we are always happy to meet new people. From 594af1c4b2ea9757cfe9f4c3552e8ac58e0963a5 Mon Sep 17 00:00:00 2001 From: noxil Date: Wed, 28 Aug 2024 00:54:42 +0200 Subject: [PATCH 10/29] feat(calendar): show all events on calender page --- content/events/_index.de.md | 2 +- content/events/_index.en.md | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 content/events/_index.en.md diff --git a/content/events/_index.de.md b/content/events/_index.de.md index 46bf406..886b48d 100644 --- a/content/events/_index.de.md +++ b/content/events/_index.de.md @@ -1,4 +1,4 @@ --- title: "Events" -calendars: ["index.ics", "https://www.c-base.org/calendar/exported/regulars.ics"] +calendars: ["index.ics"] --- diff --git a/content/events/_index.en.md b/content/events/_index.en.md new file mode 100644 index 0000000..886b48d --- /dev/null +++ b/content/events/_index.en.md @@ -0,0 +1,4 @@ +--- +title: "Events" +calendars: ["index.ics"] +--- From 69bb43455d9f7a63682783f183118836f381ab5e Mon Sep 17 00:00:00 2001 From: noxil Date: Wed, 28 Aug 2024 02:47:33 +0200 Subject: [PATCH 11/29] feat(calendar): create single event ics layout and fix calendar ics --- hugo.toml | 1 + layouts/events/list.ics | 7 +++++-- layouts/events/single.ics | 23 +++++++++++++++++++++++ 3 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 layouts/events/single.ics diff --git a/hugo.toml b/hugo.toml index c027215..6e75ab9 100644 --- a/hugo.toml +++ b/hugo.toml @@ -14,6 +14,7 @@ disableKinds = ['taxonomy', 'term'] [outputs] section = ["HTML", "RSS", "Calendar"] +page = ["HTML", "Calendar"] [module] replacements = "github.com/colinwilson/lotusdocs -> lotusdocs" diff --git a/layouts/events/list.ics b/layouts/events/list.ics index 21ffeca..f0648af 100644 --- a/layouts/events/list.ics +++ b/layouts/events/list.ics @@ -10,12 +10,15 @@ CATEGORIES:{{ .Params.category }} SEQUENCE:0 CLASS:PUBLIC SUMMARY:{{ .Title }} -{{- $description := .Content | plainify -}} -{{- $description := replace $description "\n" "=0D=0A" -}} +{{ $description := .Content | plainify }} +{{ $description := replace $description "\n" "=0D=0A" }} DESCRIPTION;ENCODING=QUOTED-PRINTABLE:{{ $description }} UID:{{.Params.start}}@berlin.freifunk.net DTSTART;TZID=Europe/Berlin;VALUE=DATE-TIME:{{dateFormat "20060102T150405" .Params.start}} DTEND;TZID=Europe/Berlin;VALUE=DATE-TIME:{{dateFormat "20060102T150405" .Params.end}} +{{ if .Params.rrule }} +RRULE:{{ .Params.rrule }} +{{ end }} URL:{{.Permalink}} END:VEVENT {{end -}} diff --git a/layouts/events/single.ics b/layouts/events/single.ics new file mode 100644 index 0000000..e2e2e43 --- /dev/null +++ b/layouts/events/single.ics @@ -0,0 +1,23 @@ +BEGIN:VCALENDAR +VERSION:2.0 +PRODID:-//freifunk berlin//hugo wegbsite generator//EN +CALSCALE:GREGORIAN +BEGIN:VEVENT +DTSTAMP;VALUE=DATE-TIME:{{ dateFormat "20060102T150405Z" .Date }} +LOCATION:{{ .Params.location }} +CATEGORIES:{{ .Params.category }} +SEQUENCE:0 +CLASS:PUBLIC +SUMMARY:{{ .Title }} +{{ $description := .Content | plainify }} +{{ $description := replace $description "\n" "=0D=0A" }} +DESCRIPTION;ENCODING=QUOTED-PRINTABLE:{{ $description }} +UID:{{.Params.start}}@berlin.freifunk.net +DTSTART;TZID=Europe/Berlin;VALUE=DATE-TIME:{{dateFormat "20060102T150405" .Params.start}} +DTEND;TZID=Europe/Berlin;VALUE=DATE-TIME:{{dateFormat "20060102T150405" .Params.end}} +{{ if .Params.rrule }} +RRULE:{{ .Params.rrule }} +{{ end }} +URL:{{.Permalink}} +END:VEVENT +END:VCALENDAR From 02995d748cc53be22ac54f58f8e6899d908a9661 Mon Sep 17 00:00:00 2001 From: noxil Date: Wed, 28 Aug 2024 02:48:02 +0200 Subject: [PATCH 12/29] feat(calendar): create layout for single event and overview --- layouts/events/list.html | 19 ++++++++++++++-- layouts/events/single.html | 45 ++++++++++++++++++++++---------------- 2 files changed, 43 insertions(+), 21 deletions(-) diff --git a/layouts/events/list.html b/layouts/events/list.html index 7cfe15d..9ff0d5e 100644 --- a/layouts/events/list.html +++ b/layouts/events/list.html @@ -1,6 +1,18 @@ {{ define "main" }}
+ + {{ $js := resources.Get "js/calendar.js" }} +{{ $params := dict }} +{{ $sourceMap := cond hugo.IsProduction "" "inline" }} +{{ $opts := dict "sourceMap" $sourceMap "minify" hugo.IsProduction "target" "es2018" "params" $params }} +{{ $js = $js | js.Build $opts }} +{{ if hugo.IsProduction }} + {{ $js = $js | fingerprint "sha384" }} +{{ end }} + + + -
- ical Feed +
+ {{ with .OutputFormats.Get "calendar" -}} + ical feed + {{- end }}
+
{{ end }} diff --git a/layouts/events/single.html b/layouts/events/single.html index ad0cd72..d93dbd6 100644 --- a/layouts/events/single.html +++ b/layouts/events/single.html @@ -1,5 +1,7 @@ {{ define "main" }}
+ {{ $built := resources.Get "js/event.js" | js.Build }} +

vertical-align:bottom">calendar_month {{ .Title }} {{ time.Format "02 Jan 2006" .Params.start }}

-
-

{{ .Content | markdownify }}

-
-
-
- location_on -

{{ .Params.location }}

-
-
- schedule -

- {{ time.Format "2 Jan 2006 15:04" .Params.start }} -
- - {{ time.Format "2 Jan 2006 15:04" .Params.end }} -

-
-
- sell -

{{ .Params.category }}

+

{{ .Content | markdownify }}

+
+
+
+ location_on +

{{ .Params.location }}

+
+
+ schedule +

+ {{ time.Format "2 Jan 2006 15:04" .Params.start }} +
+ - {{ time.Format "2 Jan 2006 15:04" .Params.end }} +

+
+ {{ if .Params.rrule }} +
+ event_repeat +

+
+ {{ end }}
+ {{ with .OutputFormats.Get "calendar" -}} + ical feed + {{- end }}
From e0b954efddd16172b9be38f05e3dfa44554e42ab Mon Sep 17 00:00:00 2001 From: noxil Date: Wed, 28 Aug 2024 02:48:26 +0200 Subject: [PATCH 13/29] chore(calendar): add js dependencies --- package-lock.json | 111 +++++++++++++++++++++++++++++++++++++++++++++- package.json | 7 ++- 2 files changed, 116 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8b5119a..31ab1b1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,9 +9,77 @@ "version": "1.0.0", "license": "ISC", "dependencies": { + "@fullcalendar/core": "^6.1.15", + "@fullcalendar/daygrid": "^6.1.15", + "@fullcalendar/icalendar": "^6.1.15", "@fullhuman/postcss-purgecss": "^6.0.0", + "fullcalendar": "^6.1.15", "postcss": "^8.4.41", - "postcss-cli": "^11.0.0" + "postcss-cli": "^11.0.0", + "rrule": "^2.8.1" + } + }, + "node_modules/@fullcalendar/core": { + "version": "6.1.15", + "resolved": "https://registry.npmjs.org/@fullcalendar/core/-/core-6.1.15.tgz", + "integrity": "sha512-BuX7o6ALpLb84cMw1FCB9/cSgF4JbVO894cjJZ6kP74jzbUZNjtwffwRdA+Id8rrLjT30d/7TrkW90k4zbXB5Q==", + "dependencies": { + "preact": "~10.12.1" + } + }, + "node_modules/@fullcalendar/daygrid": { + "version": "6.1.15", + "resolved": "https://registry.npmjs.org/@fullcalendar/daygrid/-/daygrid-6.1.15.tgz", + "integrity": "sha512-j8tL0HhfiVsdtOCLfzK2J0RtSkiad3BYYemwQKq512cx6btz6ZZ2RNc/hVnIxluuWFyvx5sXZwoeTJsFSFTEFA==", + "peerDependencies": { + "@fullcalendar/core": "~6.1.15" + } + }, + "node_modules/@fullcalendar/icalendar": { + "version": "6.1.15", + "resolved": "https://registry.npmjs.org/@fullcalendar/icalendar/-/icalendar-6.1.15.tgz", + "integrity": "sha512-iroDc02fjxWCEYE9Lg8x+4HCJTrt04ZgDddwm0LLaWUbtx24rEcnzJP34NUx0KOTLsBjel6U/33lXvU9qDCrhg==", + "peerDependencies": { + "@fullcalendar/core": "~6.1.15", + "ical.js": "^1.4.0" + } + }, + "node_modules/@fullcalendar/interaction": { + "version": "6.1.15", + "resolved": "https://registry.npmjs.org/@fullcalendar/interaction/-/interaction-6.1.15.tgz", + "integrity": "sha512-DOTSkofizM7QItjgu7W68TvKKvN9PSEEvDJceyMbQDvlXHa7pm/WAVtAc6xSDZ9xmB1QramYoWGLHkCYbTW1rQ==", + "peerDependencies": { + "@fullcalendar/core": "~6.1.15" + } + }, + "node_modules/@fullcalendar/list": { + "version": "6.1.15", + "resolved": "https://registry.npmjs.org/@fullcalendar/list/-/list-6.1.15.tgz", + "integrity": "sha512-U1bce04tYDwkFnuVImJSy2XalYIIQr6YusOWRPM/5ivHcJh67Gm8CIMSWpi3KdRSNKFkqBxLPkfZGBMaOcJYug==", + "peerDependencies": { + "@fullcalendar/core": "~6.1.15" + } + }, + "node_modules/@fullcalendar/multimonth": { + "version": "6.1.15", + "resolved": "https://registry.npmjs.org/@fullcalendar/multimonth/-/multimonth-6.1.15.tgz", + "integrity": "sha512-sEZY6jbOYkeF9TwhUldG+UUVv+hiPlGkS8zZEgPR7ypcjhipyA03c5rPjx7N6huOHqh6lCMH59zlohLooQRlaw==", + "dependencies": { + "@fullcalendar/daygrid": "~6.1.15" + }, + "peerDependencies": { + "@fullcalendar/core": "~6.1.15" + } + }, + "node_modules/@fullcalendar/timegrid": { + "version": "6.1.15", + "resolved": "https://registry.npmjs.org/@fullcalendar/timegrid/-/timegrid-6.1.15.tgz", + "integrity": "sha512-61ORr3A148RtxQ2FNG7JKvacyA/TEVZ7z6I+3E9Oeu3dqTf6M928bFcpehRTIK6zIA6Yifs7BeWHgOE9dFnpbw==", + "dependencies": { + "@fullcalendar/daygrid": "~6.1.15" + }, + "peerDependencies": { + "@fullcalendar/core": "~6.1.15" } }, "node_modules/@fullhuman/postcss-purgecss": { @@ -414,6 +482,19 @@ "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, + "node_modules/fullcalendar": { + "version": "6.1.15", + "resolved": "https://registry.npmjs.org/fullcalendar/-/fullcalendar-6.1.15.tgz", + "integrity": "sha512-CFnh1yswjRh9puJVDk8VGwTlyZ6eXxr4qLI7QCA0+bozyAm+BluP1US5mOtgk0gEq23nQxGSNDoBvAraz++saQ==", + "dependencies": { + "@fullcalendar/core": "~6.1.15", + "@fullcalendar/daygrid": "~6.1.15", + "@fullcalendar/interaction": "~6.1.15", + "@fullcalendar/list": "~6.1.15", + "@fullcalendar/multimonth": "~6.1.15", + "@fullcalendar/timegrid": "~6.1.15" + } + }, "node_modules/get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -487,6 +568,12 @@ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" }, + "node_modules/ical.js": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/ical.js/-/ical.js-1.5.0.tgz", + "integrity": "sha512-7ZxMkogUkkaCx810yp0ZGKvq1ZpRgJeornPttpoxe6nYZ3NLesZe1wWMXDdwTkj/b5NtXT+Y16Aakph/ao98ZQ==", + "peer": true + }, "node_modules/ignore": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", @@ -847,6 +934,15 @@ "node": ">=4" } }, + "node_modules/preact": { + "version": "10.12.1", + "resolved": "https://registry.npmjs.org/preact/-/preact-10.12.1.tgz", + "integrity": "sha512-l8386ixSsBdbreOAkqtrwqHwdvR35ID8c3rKPa8lCWuO86dBi32QWHV4vfsZK1utLLFMvw+Z5Ad4XLkZzchscg==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/preact" + } + }, "node_modules/pretty-hrtime": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", @@ -924,6 +1020,14 @@ "node": ">=0.10.0" } }, + "node_modules/rrule": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/rrule/-/rrule-2.8.1.tgz", + "integrity": "sha512-hM3dHSBMeaJ0Ktp7W38BJZ7O1zOgaFEsn41PDk+yHoEtfLV+PoJt9E9xAlZiWgf/iqEqionN0ebHFZIDAp+iGw==", + "dependencies": { + "tslib": "^2.4.0" + } + }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -1099,6 +1203,11 @@ "node": ">=8.0" } }, + "node_modules/tslib": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", + "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==" + }, "node_modules/unicorn-magic": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.1.0.tgz", diff --git a/package.json b/package.json index 7892d89..ab15ec5 100644 --- a/package.json +++ b/package.json @@ -9,8 +9,13 @@ "author": "", "license": "ISC", "dependencies": { + "@fullcalendar/core": "^6.1.15", + "@fullcalendar/daygrid": "^6.1.15", + "@fullcalendar/icalendar": "^6.1.15", "@fullhuman/postcss-purgecss": "^6.0.0", + "fullcalendar": "^6.1.15", "postcss": "^8.4.41", - "postcss-cli": "^11.0.0" + "postcss-cli": "^11.0.0", + "rrule": "^2.8.1" } } From e575e83869118c597df3a1bdb4d8da114afd34d9 Mon Sep 17 00:00:00 2001 From: noxil Date: Wed, 28 Aug 2024 02:49:34 +0200 Subject: [PATCH 14/29] feat(calendar): display rrule as human readable text --- assets/js/event.js | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 assets/js/event.js diff --git a/assets/js/event.js b/assets/js/event.js new file mode 100644 index 0000000..91754c7 --- /dev/null +++ b/assets/js/event.js @@ -0,0 +1,5 @@ +import { datetime, RRule, RRuleSet, rrulestr } from 'rrule' + +const rrule_element = document.querySelector("#rrule"); +const rrule_object = rrulestr(rrule_element.dataset.rrule) +rrule_element.innerHTML = rrule_object.toText() From 3f3bc706e8e743fe2cd15a42f0367584a43b7533 Mon Sep 17 00:00:00 2001 From: noxil Date: Wed, 28 Aug 2024 03:02:45 +0200 Subject: [PATCH 15/29] chore(calendar): use pipeline for js import --- assets/js/calendar.js | 18 ++++++++++++ layouts/events/list.html | 56 ++++++-------------------------------- layouts/events/single.html | 11 ++++++-- 3 files changed, 36 insertions(+), 49 deletions(-) create mode 100644 assets/js/calendar.js diff --git a/assets/js/calendar.js b/assets/js/calendar.js new file mode 100644 index 0000000..9247306 --- /dev/null +++ b/assets/js/calendar.js @@ -0,0 +1,18 @@ +import { Calendar } from '@fullcalendar/core' +import dayGridPlugin from '@fullcalendar/daygrid' +import iCalendarPlugin from '@fullcalendar/icalendar' + +document.addEventListener('DOMContentLoaded', function () { + const calendarEl = document.getElementById('calendar') + var calendar = new Calendar(calendarEl, { + plugins: [dayGridPlugin, iCalendarPlugin], + + eventSources: [ + { + url: "index.ics", + format: 'ics' + }, + ] + }) +calendar.render() +}) \ No newline at end of file diff --git a/layouts/events/list.html b/layouts/events/list.html index 9ff0d5e..f96c4a1 100644 --- a/layouts/events/list.html +++ b/layouts/events/list.html @@ -1,57 +1,19 @@ {{ define "main" }}
- +
{{ $js := resources.Get "js/calendar.js" }} -{{ $params := dict }} -{{ $sourceMap := cond hugo.IsProduction "" "inline" }} -{{ $opts := dict "sourceMap" $sourceMap "minify" hugo.IsProduction "target" "es2018" "params" $params }} -{{ $js = $js | js.Build $opts }} -{{ if hugo.IsProduction }} + {{ $params := dict }} + {{ $sourceMap := cond hugo.IsProduction "" "inline" }} + {{ $opts := dict "sourceMap" $sourceMap "minify" hugo.IsProduction "target" "es2018" "params" $params }} + {{ $js = $js | js.Build $opts }} + {{ if hugo.IsProduction }} {{ $js = $js | fingerprint "sha384" }} -{{ end }} - - - - - -
+ {{ end }} + {{ with .OutputFormats.Get "calendar" -}} ical feed - {{- end }} + {{- end }}
-
{{ end }} diff --git a/layouts/events/single.html b/layouts/events/single.html index d93dbd6..ec0638b 100644 --- a/layouts/events/single.html +++ b/layouts/events/single.html @@ -1,7 +1,5 @@ {{ define "main" }}
- {{ $built := resources.Get "js/event.js" | js.Build }} -

event_repeat

+ {{ $js := resources.Get "js/event.js" }} + {{ $params := dict }} + {{ $sourceMap := cond hugo.IsProduction "" "inline" }} + {{ $opts := dict "sourceMap" $sourceMap "minify" hugo.IsProduction "target" "es2018" "params" $params }} + {{ $js = $js | js.Build $opts }} + {{ if hugo.IsProduction }} + {{ $js = $js | fingerprint "sha384" }} + {{ end }} + {{ end }}
{{ with .OutputFormats.Get "calendar" -}} From 03ad612e20138ced3a0bf9e57d7b9dea54c1c4f7 Mon Sep 17 00:00:00 2001 From: noxil Date: Wed, 28 Aug 2024 03:38:57 +0200 Subject: [PATCH 16/29] chore(calendar): define output in frontmatter --- archetypes/event.md | 13 +++++++++++++ content/events/freifunktreffen.de.md | 3 +++ content/events/freifunktreffen.en.md | 3 +++ hugo.toml | 1 - 4 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 archetypes/event.md diff --git a/archetypes/event.md b/archetypes/event.md new file mode 100644 index 0000000..48815c4 --- /dev/null +++ b/archetypes/event.md @@ -0,0 +1,13 @@ +--- +outputs: +- html +- calendar +title: "{{ replace .File.ContentBaseName "-" " " | title }}" +start: "{{ dateFormat "2006-01-02T15:04:05" .Date }}" +end: "{{ dateFormat "2006-01-02T15:04:05" .Date }}" +# for recurring events add rrule with https://icalendar.org/rrule-tool.html +#rrule: "" +location: "Berlin" +--- + +Description of the event ... \ No newline at end of file diff --git a/content/events/freifunktreffen.de.md b/content/events/freifunktreffen.de.md index 2313f51..5ae3433 100644 --- a/content/events/freifunktreffen.de.md +++ b/content/events/freifunktreffen.de.md @@ -1,4 +1,7 @@ --- +outputs: +- html +- calendar title: "Freifunktreffen auf der c-base" start: "2024-07-03T20:00:00" end: "2024-07-03T15:23:00" diff --git a/content/events/freifunktreffen.en.md b/content/events/freifunktreffen.en.md index bf50a13..b50ea5e 100644 --- a/content/events/freifunktreffen.en.md +++ b/content/events/freifunktreffen.en.md @@ -1,4 +1,7 @@ --- +outputs: +- html +- calendar title: "Freifunk meet up on the c-base" start: "2024-07-03T20:00:00" end: "2024-07-03T15:23:00" diff --git a/hugo.toml b/hugo.toml index 6e75ab9..c027215 100644 --- a/hugo.toml +++ b/hugo.toml @@ -14,7 +14,6 @@ disableKinds = ['taxonomy', 'term'] [outputs] section = ["HTML", "RSS", "Calendar"] -page = ["HTML", "Calendar"] [module] replacements = "github.com/colinwilson/lotusdocs -> lotusdocs" From 41962fe8628bd4a31aff67325b1978ce7636ac07 Mon Sep 17 00:00:00 2001 From: noxil Date: Wed, 28 Aug 2024 03:39:20 +0200 Subject: [PATCH 17/29] chore(calendar): document event creation --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index f7e5f2f..e1c9fad 100644 --- a/README.md +++ b/README.md @@ -54,3 +54,13 @@ To display up to date information, we fetch and generate some data during the bu - activities-mailinglist (activities section) - activities-matrix (activities section) - activities-github (activities section) + +## Events + +The events for the calendar are stored in simple markdown files. To create a new event, use the following commands: +``` +hugo new content --kind event events/.de.md +hugo new content --kind event events/.en.md +``` + +Now you can edit the event at `events/.de.md` and `events/.en.md`. From c833c549b7b3121e8ae981d0b770dbd4191ea17c Mon Sep 17 00:00:00 2001 From: noxil Date: Wed, 28 Aug 2024 04:13:35 +0200 Subject: [PATCH 18/29] fix(linting): reformat md files and fix linting in js --- .github/linters/.eslintrc.yml | 1 + README.md | 3 ++- archetypes/event.md | 2 +- assets/js/calendar.js | 19 +++++++++---------- assets/js/event.js | 8 ++++---- content/events/freifunktreffen.de.md | 1 - 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/linters/.eslintrc.yml b/.github/linters/.eslintrc.yml index 525caf9..edfb1f0 100644 --- a/.github/linters/.eslintrc.yml +++ b/.github/linters/.eslintrc.yml @@ -2,5 +2,6 @@ ignorePatterns: ["layouts/page/single.json", "package.json", "package-lock.json", "assets/js/bootstrap.js"] parserOptions: ecmaVersion: latest + sourceType: module env: es6: true diff --git a/README.md b/README.md index e1c9fad..cd08a23 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,8 @@ To display up to date information, we fetch and generate some data during the bu ## Events The events for the calendar are stored in simple markdown files. To create a new event, use the following commands: -``` + +```bash hugo new content --kind event events/.de.md hugo new content --kind event events/.en.md ``` diff --git a/archetypes/event.md b/archetypes/event.md index 48815c4..eb37322 100644 --- a/archetypes/event.md +++ b/archetypes/event.md @@ -10,4 +10,4 @@ end: "{{ dateFormat "2006-01-02T15:04:05" .Date }}" location: "Berlin" --- -Description of the event ... \ No newline at end of file +Description of the event ... diff --git a/assets/js/calendar.js b/assets/js/calendar.js index 9247306..63fbf46 100644 --- a/assets/js/calendar.js +++ b/assets/js/calendar.js @@ -4,15 +4,14 @@ import iCalendarPlugin from '@fullcalendar/icalendar' document.addEventListener('DOMContentLoaded', function () { const calendarEl = document.getElementById('calendar') - var calendar = new Calendar(calendarEl, { + const calendar = new Calendar(calendarEl, { plugins: [dayGridPlugin, iCalendarPlugin], - eventSources: [ - { - url: "index.ics", - format: 'ics' - }, - ] - }) -calendar.render() -}) \ No newline at end of file + { + url: 'index.ics', + format: 'ics' + } + ] + }) + calendar.render() +}) diff --git a/assets/js/event.js b/assets/js/event.js index 91754c7..ac8a9b2 100644 --- a/assets/js/event.js +++ b/assets/js/event.js @@ -1,5 +1,5 @@ -import { datetime, RRule, RRuleSet, rrulestr } from 'rrule' +import { rrulestr } from 'rrule' -const rrule_element = document.querySelector("#rrule"); -const rrule_object = rrulestr(rrule_element.dataset.rrule) -rrule_element.innerHTML = rrule_object.toText() +const rruleElement = document.querySelector('#rrule') +const rruleObject = rrulestr(rruleElement.dataset.rrule) +rruleElement.innerHTML = rruleObject.toText() diff --git a/content/events/freifunktreffen.de.md b/content/events/freifunktreffen.de.md index 5ae3433..ae86f58 100644 --- a/content/events/freifunktreffen.de.md +++ b/content/events/freifunktreffen.de.md @@ -12,4 +12,3 @@ location: "Rungestraße 20, 10179 Berlin" Hier kannst du viele andere Freifunkende treffen und Kontakte schließen. Wir nutzen dieses Treffen, um Community-Themen zu besprechen und bei einem leckeren Getränk eine schöne Zeit zu haben. Die [c-base](https://www.openstreetmap.org/?mlat=52.51297&mlon=13.42011#map=17/52.51297/13.42011) ist an der Spree, ganz in der Nähe vom Bahnhof Jannowitzbrücke. Du möchtest ein Thema vorschlagen, dass wir als Community besprechen sollten? Schicke deinen Themenvorschlag über die Mailingliste. Komm gerne einfach vorbei, wir freuen uns immer über neue Menschen. - From fac7aadc9b40f62f7301ce8d7031295c5658faad Mon Sep 17 00:00:00 2001 From: noxil Date: Wed, 28 Aug 2024 04:49:04 +0200 Subject: [PATCH 19/29] fix(calendar): add meta description and set remove deprecated calendar data --- content/events/_index.de.md | 2 +- content/events/_index.en.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/content/events/_index.de.md b/content/events/_index.de.md index 886b48d..90f78cb 100644 --- a/content/events/_index.de.md +++ b/content/events/_index.de.md @@ -1,4 +1,4 @@ --- title: "Events" -calendars: ["index.ics"] +description: "Ein Überblick der Freifunk-Events in der nächsten Zeit. Komm gerne vorbei." --- diff --git a/content/events/_index.en.md b/content/events/_index.en.md index 886b48d..98dd628 100644 --- a/content/events/_index.en.md +++ b/content/events/_index.en.md @@ -1,4 +1,4 @@ --- title: "Events" -calendars: ["index.ics"] +description: "An overview of Freifunk events in the near future. Feel free to drop by." --- From fbde094433c5176c18a4a41366fe7616a863c498 Mon Sep 17 00:00:00 2001 From: noxil Date: Tue, 3 Sep 2024 15:19:06 +0200 Subject: [PATCH 20/29] fix(calendar): remove extra characters from newline --- layouts/events/list.ics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/events/list.ics b/layouts/events/list.ics index f0648af..9a6a9e6 100644 --- a/layouts/events/list.ics +++ b/layouts/events/list.ics @@ -11,7 +11,7 @@ SEQUENCE:0 CLASS:PUBLIC SUMMARY:{{ .Title }} {{ $description := .Content | plainify }} -{{ $description := replace $description "\n" "=0D=0A" }} +{{ $description := replace $description "\n" "" }} DESCRIPTION;ENCODING=QUOTED-PRINTABLE:{{ $description }} UID:{{.Params.start}}@berlin.freifunk.net DTSTART;TZID=Europe/Berlin;VALUE=DATE-TIME:{{dateFormat "20060102T150405" .Params.start}} From 846214232e9286f5e0169840e7502d41e47b2689 Mon Sep 17 00:00:00 2001 From: noxil Date: Tue, 3 Sep 2024 15:30:00 +0200 Subject: [PATCH 21/29] fix(calendar): set correct end time for meetup event --- content/events/freifunktreffen.de.md | 2 +- content/events/freifunktreffen.en.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/content/events/freifunktreffen.de.md b/content/events/freifunktreffen.de.md index ae86f58..a7cf6d2 100644 --- a/content/events/freifunktreffen.de.md +++ b/content/events/freifunktreffen.de.md @@ -4,7 +4,7 @@ outputs: - calendar title: "Freifunktreffen auf der c-base" start: "2024-07-03T20:00:00" -end: "2024-07-03T15:23:00" +end: "2024-07-03T23:00:00" rrule: "FREQ=MONTHLY;INTERVAL=1;BYDAY=1WE" location: "Rungestraße 20, 10179 Berlin" --- diff --git a/content/events/freifunktreffen.en.md b/content/events/freifunktreffen.en.md index b50ea5e..2a4259c 100644 --- a/content/events/freifunktreffen.en.md +++ b/content/events/freifunktreffen.en.md @@ -4,7 +4,7 @@ outputs: - calendar title: "Freifunk meet up on the c-base" start: "2024-07-03T20:00:00" -end: "2024-07-03T15:23:00" +end: "2024-07-03T23:00:00" rrule: "FREQ=MONTHLY;INTERVAL=1;BYDAY=1WE" location: "Rungestraße 20, 10179 Berlin" --- From f15eb8cd4536a8f111f132290994295e9145a54a Mon Sep 17 00:00:00 2001 From: noxil Date: Fri, 6 Sep 2024 19:43:38 +0200 Subject: [PATCH 22/29] fix(calendar): make single event page fit layout width --- layouts/events/single.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/layouts/events/single.html b/layouts/events/single.html index ec0638b..656242d 100644 --- a/layouts/events/single.html +++ b/layouts/events/single.html @@ -1,6 +1,6 @@ {{ define "main" }} -
-
+
+

+
{{ $js := resources.Get "js/calendar.js" }} From 2e6db6905738b948beccb31740f060cbe29ce743 Mon Sep 17 00:00:00 2001 From: noxil Date: Sat, 7 Sep 2024 00:26:49 +0200 Subject: [PATCH 25/29] chore(events): shorten event names for better visability --- content/events/freifunktreffen.de.md | 2 +- content/events/freifunktreffen.en.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/content/events/freifunktreffen.de.md b/content/events/freifunktreffen.de.md index a7cf6d2..a400ed6 100644 --- a/content/events/freifunktreffen.de.md +++ b/content/events/freifunktreffen.de.md @@ -2,7 +2,7 @@ outputs: - html - calendar -title: "Freifunktreffen auf der c-base" +title: "Freifunktreffen" start: "2024-07-03T20:00:00" end: "2024-07-03T23:00:00" rrule: "FREQ=MONTHLY;INTERVAL=1;BYDAY=1WE" diff --git a/content/events/freifunktreffen.en.md b/content/events/freifunktreffen.en.md index 2a4259c..4144e42 100644 --- a/content/events/freifunktreffen.en.md +++ b/content/events/freifunktreffen.en.md @@ -2,7 +2,7 @@ outputs: - html - calendar -title: "Freifunk meet up on the c-base" +title: "Freifunk meet-up" start: "2024-07-03T20:00:00" end: "2024-07-03T23:00:00" rrule: "FREQ=MONTHLY;INTERVAL=1;BYDAY=1WE" From 818c7dcd01609357041ad37f018c7cea9b65cae5 Mon Sep 17 00:00:00 2001 From: noxil Date: Sat, 7 Sep 2024 00:50:02 +0200 Subject: [PATCH 26/29] feat(event): add rrule_text so that translations of rrules are possible --- assets/js/event.js | 5 ---- content/events/freifunktreffen.de.md | 1 + content/events/freifunktreffen.en.md | 1 + layouts/events/single.html | 34 ++++++++++++++++------------ package-lock.json | 16 +------------ package.json | 3 +-- 6 files changed, 23 insertions(+), 37 deletions(-) delete mode 100644 assets/js/event.js diff --git a/assets/js/event.js b/assets/js/event.js deleted file mode 100644 index ac8a9b2..0000000 --- a/assets/js/event.js +++ /dev/null @@ -1,5 +0,0 @@ -import { rrulestr } from 'rrule' - -const rruleElement = document.querySelector('#rrule') -const rruleObject = rrulestr(rruleElement.dataset.rrule) -rruleElement.innerHTML = rruleObject.toText() diff --git a/content/events/freifunktreffen.de.md b/content/events/freifunktreffen.de.md index a400ed6..8eb03aa 100644 --- a/content/events/freifunktreffen.de.md +++ b/content/events/freifunktreffen.de.md @@ -6,6 +6,7 @@ title: "Freifunktreffen" start: "2024-07-03T20:00:00" end: "2024-07-03T23:00:00" rrule: "FREQ=MONTHLY;INTERVAL=1;BYDAY=1WE" +rrule_text: "Jeden ersten Mittwoch im Monat" location: "Rungestraße 20, 10179 Berlin" --- diff --git a/content/events/freifunktreffen.en.md b/content/events/freifunktreffen.en.md index 4144e42..848d73a 100644 --- a/content/events/freifunktreffen.en.md +++ b/content/events/freifunktreffen.en.md @@ -6,6 +6,7 @@ title: "Freifunk meet-up" start: "2024-07-03T20:00:00" end: "2024-07-03T23:00:00" rrule: "FREQ=MONTHLY;INTERVAL=1;BYDAY=1WE" +rrule_text: "Every first Wednesday of the month" location: "Rungestraße 20, 10179 Berlin" --- diff --git a/layouts/events/single.html b/layouts/events/single.html index 656242d..0ce8ef2 100644 --- a/layouts/events/single.html +++ b/layouts/events/single.html @@ -5,7 +5,13 @@

calendar_month {{ .Title }} {{ time.Format "02 Jan 2006" .Params.start }} + vertical-align:bottom">calendar_month + {{ .Title }} + {{ if not .Params.rrule }} + + {{ time.Format "02 Jan 2006" .Params.start }} + + {{ end }}

{{ .Content | markdownify }}

@@ -15,28 +21,26 @@

location_on

{{ .Params.location }}

+ {{ if .Params.rrule }}
schedule

- {{ time.Format "2 Jan 2006 15:04" .Params.start }} -
- - {{ time.Format "2 Jan 2006 15:04" .Params.end }} + {{ time.Format "15:04" .Params.start }} - {{ time.Format "15:04" .Params.end }}

- {{ if .Params.rrule }}
event_repeat -

+

{{ .Params.rrule_text }}

+
+ {{ else }} +
+ schedule +

+ {{ time.Format "2 Jan 2006 15:04" .Params.start }} +
+ - {{ time.Format "2 Jan 2006 15:04" .Params.end }} +

- {{ $js := resources.Get "js/event.js" }} - {{ $params := dict }} - {{ $sourceMap := cond hugo.IsProduction "" "inline" }} - {{ $opts := dict "sourceMap" $sourceMap "minify" hugo.IsProduction "target" "es2018" "params" $params }} - {{ $js = $js | js.Build $opts }} - {{ if hugo.IsProduction }} - {{ $js = $js | fingerprint "sha384" }} - {{ end }} - {{ end }}
{{ with .OutputFormats.Get "calendar" -}} diff --git a/package-lock.json b/package-lock.json index 31ab1b1..c39113e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,8 +15,7 @@ "@fullhuman/postcss-purgecss": "^6.0.0", "fullcalendar": "^6.1.15", "postcss": "^8.4.41", - "postcss-cli": "^11.0.0", - "rrule": "^2.8.1" + "postcss-cli": "^11.0.0" } }, "node_modules/@fullcalendar/core": { @@ -1020,14 +1019,6 @@ "node": ">=0.10.0" } }, - "node_modules/rrule": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/rrule/-/rrule-2.8.1.tgz", - "integrity": "sha512-hM3dHSBMeaJ0Ktp7W38BJZ7O1zOgaFEsn41PDk+yHoEtfLV+PoJt9E9xAlZiWgf/iqEqionN0ebHFZIDAp+iGw==", - "dependencies": { - "tslib": "^2.4.0" - } - }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -1203,11 +1194,6 @@ "node": ">=8.0" } }, - "node_modules/tslib": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", - "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==" - }, "node_modules/unicorn-magic": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.1.0.tgz", diff --git a/package.json b/package.json index ab15ec5..7bb73db 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,6 @@ "@fullhuman/postcss-purgecss": "^6.0.0", "fullcalendar": "^6.1.15", "postcss": "^8.4.41", - "postcss-cli": "^11.0.0", - "rrule": "^2.8.1" + "postcss-cli": "^11.0.0" } } From 19441afe7272a6d7029e24269a248a5c020c57e2 Mon Sep 17 00:00:00 2001 From: noxil Date: Sat, 7 Sep 2024 01:38:32 +0200 Subject: [PATCH 27/29] fix(event): change contrast of soft-box for accessibility --- assets/scss/custom/structure/_general.scss | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/assets/scss/custom/structure/_general.scss b/assets/scss/custom/structure/_general.scss index bb0b4c9..ff2ff66 100644 --- a/assets/scss/custom/structure/_general.scss +++ b/assets/scss/custom/structure/_general.scss @@ -1,4 +1,4 @@ -// Overwriting the theme stylesheet to reenable link decoration +// Overwriting the theme stylesheet to reenable link decoration and fix contrast on bg-soft-primary body { font-family: $font-family-secondary; @@ -37,4 +37,8 @@ p { #navigation a { text-decoration: none !important; +} + +div.bg-soft-primary { + background: rgba($primary, 0.05) !important; } \ No newline at end of file From b5b76bfb0ce144f70bae659cad0509f905dd3893 Mon Sep 17 00:00:00 2001 From: noxil Date: Sat, 7 Sep 2024 01:41:21 +0200 Subject: [PATCH 28/29] chore(event): add communityday event --- content/events/communityday-2024-09.de .md | 11 +++++++++++ content/events/communityday-2024-09.en.md | 11 +++++++++++ 2 files changed, 22 insertions(+) create mode 100644 content/events/communityday-2024-09.de .md create mode 100644 content/events/communityday-2024-09.en.md diff --git a/content/events/communityday-2024-09.de .md b/content/events/communityday-2024-09.de .md new file mode 100644 index 0000000..c041954 --- /dev/null +++ b/content/events/communityday-2024-09.de .md @@ -0,0 +1,11 @@ +--- +outputs: +- html +- calendar +title: "Community Tag" +start: "2024-09-22T14:00:00" +end: "2024-09-22T22:00:00" +location: "Kirchhofstraße 45, 12055 Berlin" +--- + +Mehr infos kommen bald. diff --git a/content/events/communityday-2024-09.en.md b/content/events/communityday-2024-09.en.md new file mode 100644 index 0000000..f7f385c --- /dev/null +++ b/content/events/communityday-2024-09.en.md @@ -0,0 +1,11 @@ +--- +outputs: +- html +- calendar +title: "Community day" +start: "2024-09-22T14:00:00" +end: "2024-09-22T22:00:00" +location: "Kirchhofstraße 45, 12055 Berlin" +--- + +More infos coming soon. From ed9001ef193f3a2f7b58ecccde0c455bf194f32b Mon Sep 17 00:00:00 2001 From: noxil Date: Sat, 7 Sep 2024 11:40:03 +0200 Subject: [PATCH 29/29] fix(calendar): set auto height to avoid vertical scroll --- assets/js/calendar.js | 1 + 1 file changed, 1 insertion(+) diff --git a/assets/js/calendar.js b/assets/js/calendar.js index 3c46fb1..a02e718 100644 --- a/assets/js/calendar.js +++ b/assets/js/calendar.js @@ -8,6 +8,7 @@ document.addEventListener('DOMContentLoaded', function () { const calendar = new Calendar(calendarEl, { plugins: [dayGridPlugin, iCalendarPlugin], eventDisplay: 'block', + contentHeight: 'auto', eventSources: [ { url: 'index.ics',