diff --git a/config/_default/hugo.toml b/config/_default/hugo.toml index de88bdd..9090cd4 100644 --- a/config/_default/hugo.toml +++ b/config/_default/hugo.toml @@ -42,8 +42,8 @@ enableEmoji = true [outputs] home = ["HTML", "RSS", "JSON"] - section = ["HTML", "Calendar", "RSS", "XML", "ICS"] - page = ["HTML", "Calendar", "ICS"] + section = ["HTML", "Calendar", "RSS", "XML"] + page = ["HTML", "Calendar"] # Output Formats Configuration [outputFormats.Calendar] diff --git a/layouts/_default/list.ics b/layouts/_default/list.ics deleted file mode 100644 index beb3274..0000000 --- a/layouts/_default/list.ics +++ /dev/null @@ -1,23 +0,0 @@ -{{- $time_zone := "Europe/Berlin" -}} -BEGIN:VCALENDAR -VERSION:2.0 -PRODID:-//CCCB//Calendar//DE -CALSCALE:GREGORIAN -METHOD:PUBLISH -X-WR-CALNAME:CCCB Calendar -X-WR-TIMEZONE:{{ $time_zone }} -{{ range .Pages }} -{{ if and .Params.dtstart .Params.dtend }} -BEGIN:VEVENT -UID:{{ .File.BaseFileName }}@berlin.ccc.de -SUMMARY:{{ .Title }} -{{ with .Params.subtitle }}DESCRIPTION:{{ . }}{{ end }} -URL:https://berlin.ccc.de{{ .RelPermalink }} -{{ with .Params.dtstart }}DTSTART:{{ . }}{{ end }} -{{ with .Params.dtend }}DTEND:{{ . }}{{ end }} -{{ with .Params.rrule }}RRULE:{{ . }}{{ end }} -DTSTAMP:{{ now.Format "20060102T150405Z" }} -END:VEVENT -{{ end }} -{{ end }} -END:VCALENDAR \ No newline at end of file diff --git a/layouts/datengarten/section.ics b/layouts/datengarten/section.ics index d6a9227..80768b5 100644 --- a/layouts/datengarten/section.ics +++ b/layouts/datengarten/section.ics @@ -19,20 +19,36 @@ TZNAME:CET DTSTART:19701025T030000 END:STANDARD END:VTIMEZONE - -{{ range .Pages }} BEGIN:VEVENT ORGANIZER;CN="CCCB":mailto:datengarten@berlin.ccc.de -SUMMARY:{{ .Title }}{{ with .Params.subtitle }}: {{ . }}{{ end }} -UID:{{ .Params.no }}@datengarten.berlin.ccc.de +SUMMARY:Datengarten +UID: 0@datengarten.berlin.ccc.de SEQUENCE:0 STATUS:CONFIRMED -DTSTAMP:{{ dateFormat "20060102T150405Z" .Params.event.start }} -DTSTART;TZID=Europe/Berlin:{{ dateFormat "20060102T150405" .Params.event.start }} -DTEND;TZID=Europe/Berlin:{{ dateFormat "20060102T150405" .Params.event.end }} -LOCATION:{{ with .Params.location }}{{ . }}{{ else }}CCCB{{ end }} -URL:{{ .Permalink }} -DESCRIPTION:{{ .Permalink }} +DTSTAMP:20180508T200000Z +DTSTART;TZID=Europe/Berlin:20180508T200000 +DTEND;TZID=Europe/Berlin:20180508T220000 +RRULE:FREQ=MONTHLY;BYSETPOS=2;BYDAY=TU;INTERVAL=1;UNTIL=20190409T220000 +{{range .Pages -}} +EXDATE;TZID=Europe/Berlin:{{dateFormat "20060102T150405" .Params.event.start}} +{{end -}} +LOCATION:{{with .Params.location}}{{.}}{{else}}CCCB{{end}} +URL:{{.Permalink}} +DESCRIPTION:{{.Permalink}} END:VEVENT -{{ end }} +{{range .Pages -}} +BEGIN:VEVENT +ORGANIZER;CN="CCCB":mailto:datengarten@berlin.ccc.de +SUMMARY:{{.Title}}{{with .Params.subtitle}}: {{.}}{{end}} +UID:{{.Params.no}}@datengarten.berlin.ccc.de +SEQUENCE:0 +STATUS:CONFIRMED +DTSTAMP:{{dateFormat "20060102T150405Z" .Params.event.start}} +DTSTART;TZID=Europe/Berlin:{{dateFormat "20060102T150405" .Params.event.start}} +DTEND;TZID=Europe/Berlin:{{dateFormat "20060102T150405" .Params.event.end}} +LOCATION:{{with .Params.location}}{{.}}{{else}}CCCB{{end}} +URL:{{.Permalink}} +DESCRIPTION:{{.Permalink}} +END:VEVENT +{{end -}} END:VCALENDAR diff --git a/layouts/shortcodes/calendar.html b/layouts/shortcodes/calendar.html index 52812c7..b7e2271 100644 --- a/layouts/shortcodes/calendar.html +++ b/layouts/shortcodes/calendar.html @@ -1,35 +1,31 @@ -{{ $js := resources.Get "js/calendar.js" }} -{{ $css := resources.Get "css/calendar.css" }} +{{ $style := resources.Get "css/calendar.css" | resources.ToCSS | resources.Fingerprint }} + + +{{ $js := resources.Get "js/calendar.js" | resources.Fingerprint }} +
- {{ with $css }} - - {{ end }} - {{ with $js }} - - {{ end }} - -
-
- - - +
+
+ + + +
+ + + + + + + + + + + + + +
MoDiMiDoFrSaSo
- - - - - - - - - - - - - -
MoDiMiDoFrSaSo
-
diff --git a/layouts/veranstaltungen/list.ics b/layouts/veranstaltungen/list.ics deleted file mode 100644 index 7830884..0000000 --- a/layouts/veranstaltungen/list.ics +++ /dev/null @@ -1,25 +0,0 @@ -{{- $time_zone := "Europe/Berlin" -}} -BEGIN:VCALENDAR -VERSION:2.0 -PRODID:-//CCCB//Calendar//DE -CALSCALE:GREGORIAN -METHOD:PUBLISH -X-WR-CALNAME:CCCB Veranstaltungen -X-WR-TIMEZONE:{{ $time_zone }} -{{ range .Pages }} -BEGIN:VEVENT -UID:{{ .File.BaseFileName }}@berlin.ccc.de -SUMMARY:{{ .Title }} -{{ with .Params.subtitle }} -DESCRIPTION:{{ . }} - -Link: https://berlin.ccc.de{{ $.RelPermalink }} -{{ end }} -URL:https://berlin.ccc.de{{ .RelPermalink }} -{{ with .Params.dtstart }}DTSTART:{{ . }}{{ end }} -{{ with .Params.dtend }}DTEND:{{ . }}{{ end }} -{{ with .Params.rrule }}RRULE:{{ . }}{{ end }} -DTSTAMP:{{ now.Format "20060102T150405Z" }} -END:VEVENT -{{ end }} -END:VCALENDAR \ No newline at end of file diff --git a/tools/gen_upcoming.py b/tools/gen_upcoming.py index 0f69f6a..03494a3 100755 --- a/tools/gen_upcoming.py +++ b/tools/gen_upcoming.py @@ -56,10 +56,8 @@ def find_events(icsfilestr, start, end, num): if event.name == "VEVENT": if "RRULE" in event.keys(): events.extend(parse_recurring_event(event, start, end)) - else: - ev = parse_single_event(event, start, end) - if ev is not None: - events.append(ev) + elif ev := parse_single_event(event, start, end) != None: + events.append(ev) events = sorted(events, key=lambda k: k["begin"]) events = events[0:num] diff --git a/tools/merge_cals.py b/tools/merge_cals.py index 136904e..c406c93 100755 --- a/tools/merge_cals.py +++ b/tools/merge_cals.py @@ -18,10 +18,6 @@ for icsfilestr in glob("public/*/**/*.ics", recursive=True): for calendar in calendars: for event in calendar.subcomponents: - if event.name != "VEVENT": - continue - if "DTSTART" not in event: - continue merged.add_component(event) outfile = "static/all.ics"