Compare commits
No commits in common. "79baa813f91234ce45d333faa7070d5b362ca5f5" and "238fdab51ca709e44c6193fa38ff05446030299e" have entirely different histories.
79baa813f9
...
238fdab51c
|
@ -42,8 +42,8 @@ enableEmoji = true
|
||||||
|
|
||||||
[outputs]
|
[outputs]
|
||||||
home = ["HTML", "RSS", "JSON"]
|
home = ["HTML", "RSS", "JSON"]
|
||||||
section = ["HTML", "Calendar", "RSS", "XML", "ICS"]
|
section = ["HTML", "Calendar", "RSS", "XML"]
|
||||||
page = ["HTML", "Calendar", "ICS"]
|
page = ["HTML", "Calendar"]
|
||||||
|
|
||||||
# Output Formats Configuration
|
# Output Formats Configuration
|
||||||
[outputFormats.Calendar]
|
[outputFormats.Calendar]
|
||||||
|
|
|
@ -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
|
|
|
@ -19,8 +19,24 @@ TZNAME:CET
|
||||||
DTSTART:19701025T030000
|
DTSTART:19701025T030000
|
||||||
END:STANDARD
|
END:STANDARD
|
||||||
END:VTIMEZONE
|
END:VTIMEZONE
|
||||||
|
BEGIN:VEVENT
|
||||||
{{ range .Pages }}
|
ORGANIZER;CN="CCCB":mailto:datengarten@berlin.ccc.de
|
||||||
|
SUMMARY:Datengarten
|
||||||
|
UID: 0@datengarten.berlin.ccc.de
|
||||||
|
SEQUENCE:0
|
||||||
|
STATUS:CONFIRMED
|
||||||
|
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
|
||||||
|
{{range .Pages -}}
|
||||||
BEGIN:VEVENT
|
BEGIN:VEVENT
|
||||||
ORGANIZER;CN="CCCB":mailto:datengarten@berlin.ccc.de
|
ORGANIZER;CN="CCCB":mailto:datengarten@berlin.ccc.de
|
||||||
SUMMARY:{{.Title}}{{with .Params.subtitle}}: {{.}}{{end}}
|
SUMMARY:{{.Title}}{{with .Params.subtitle}}: {{.}}{{end}}
|
||||||
|
@ -34,5 +50,5 @@ LOCATION:{{ with .Params.location }}{{ . }}{{ else }}CCCB{{ end }}
|
||||||
URL:{{.Permalink}}
|
URL:{{.Permalink}}
|
||||||
DESCRIPTION:{{.Permalink}}
|
DESCRIPTION:{{.Permalink}}
|
||||||
END:VEVENT
|
END:VEVENT
|
||||||
{{ end }}
|
{{end -}}
|
||||||
END:VCALENDAR
|
END:VCALENDAR
|
||||||
|
|
|
@ -1,14 +1,10 @@
|
||||||
{{ $js := resources.Get "js/calendar.js" }}
|
{{ $style := resources.Get "css/calendar.css" | resources.ToCSS | resources.Fingerprint }}
|
||||||
{{ $css := resources.Get "css/calendar.css" }}
|
<link rel="stylesheet" href="{{ $style.RelPermalink }}">
|
||||||
|
|
||||||
|
{{ $js := resources.Get "js/calendar.js" | resources.Fingerprint }}
|
||||||
|
<script src="{{ $js.RelPermalink }}" defer></script>
|
||||||
|
|
||||||
<div class="calendar-container">
|
<div class="calendar-container">
|
||||||
{{ with $css }}
|
|
||||||
<link rel="stylesheet" href="{{ .RelPermalink }}">
|
|
||||||
{{ end }}
|
|
||||||
{{ with $js }}
|
|
||||||
<script src="{{ .RelPermalink }}"></script>
|
|
||||||
{{ end }}
|
|
||||||
|
|
||||||
<div id="calendar">
|
<div id="calendar">
|
||||||
<div id="calendar-controls">
|
<div id="calendar-controls">
|
||||||
<button id="prev-month">←</button>
|
<button id="prev-month">←</button>
|
||||||
|
|
|
@ -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
|
|
|
@ -56,9 +56,7 @@ def find_events(icsfilestr, start, end, num):
|
||||||
if event.name == "VEVENT":
|
if event.name == "VEVENT":
|
||||||
if "RRULE" in event.keys():
|
if "RRULE" in event.keys():
|
||||||
events.extend(parse_recurring_event(event, start, end))
|
events.extend(parse_recurring_event(event, start, end))
|
||||||
else:
|
elif ev := parse_single_event(event, start, end) != None:
|
||||||
ev = parse_single_event(event, start, end)
|
|
||||||
if ev is not None:
|
|
||||||
events.append(ev)
|
events.append(ev)
|
||||||
|
|
||||||
events = sorted(events, key=lambda k: k["begin"])
|
events = sorted(events, key=lambda k: k["begin"])
|
||||||
|
|
|
@ -18,10 +18,6 @@ for icsfilestr in glob("public/*/**/*.ics", recursive=True):
|
||||||
|
|
||||||
for calendar in calendars:
|
for calendar in calendars:
|
||||||
for event in calendar.subcomponents:
|
for event in calendar.subcomponents:
|
||||||
if event.name != "VEVENT":
|
|
||||||
continue
|
|
||||||
if "DTSTART" not in event:
|
|
||||||
continue
|
|
||||||
merged.add_component(event)
|
merged.add_component(event)
|
||||||
|
|
||||||
outfile = "static/all.ics"
|
outfile = "static/all.ics"
|
||||||
|
|
Loading…
Reference in a new issue