Merge branch 'staging' into production
This commit is contained in:
		
						commit
						79baa813f9
					
				
					 7 changed files with 98 additions and 56 deletions
				
			
		| 
						 | 
					@ -42,8 +42,8 @@ enableEmoji = true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[outputs]
 | 
					[outputs]
 | 
				
			||||||
  home = ["HTML", "RSS", "JSON"]
 | 
					  home = ["HTML", "RSS", "JSON"]
 | 
				
			||||||
  section = ["HTML", "Calendar", "RSS", "XML"]
 | 
					  section = ["HTML", "Calendar", "RSS", "XML", "ICS"]
 | 
				
			||||||
  page = ["HTML", "Calendar"]
 | 
					  page = ["HTML", "Calendar", "ICS"]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Output Formats Configuration
 | 
					# Output Formats Configuration
 | 
				
			||||||
[outputFormats.Calendar]
 | 
					[outputFormats.Calendar]
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										23
									
								
								layouts/_default/list.ics
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								layouts/_default/list.ics
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,23 @@
 | 
				
			||||||
 | 
					{{- $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,24 +19,8 @@ TZNAME:CET
 | 
				
			||||||
DTSTART:19701025T030000
 | 
					DTSTART:19701025T030000
 | 
				
			||||||
END:STANDARD
 | 
					END:STANDARD
 | 
				
			||||||
END:VTIMEZONE
 | 
					END:VTIMEZONE
 | 
				
			||||||
BEGIN:VEVENT
 | 
					
 | 
				
			||||||
ORGANIZER;CN="CCCB":mailto:datengarten@berlin.ccc.de
 | 
					{{ range .Pages }}
 | 
				
			||||||
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 }}
 | 
				
			||||||
| 
						 | 
					@ -50,5 +34,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,10 +1,14 @@
 | 
				
			||||||
{{ $style := resources.Get "css/calendar.css" | resources.ToCSS | resources.Fingerprint }}
 | 
					{{ $js := resources.Get "js/calendar.js" }}
 | 
				
			||||||
<link rel="stylesheet" href="{{ $style.RelPermalink }}">
 | 
					{{ $css := resources.Get "css/calendar.css" }}
 | 
				
			||||||
 | 
					 | 
				
			||||||
{{ $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>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										25
									
								
								layouts/veranstaltungen/list.ics
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								layouts/veranstaltungen/list.ics
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,25 @@
 | 
				
			||||||
 | 
					{{- $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,7 +56,9 @@ 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))
 | 
				
			||||||
            elif ev := parse_single_event(event, start, end) != None:
 | 
					            else:
 | 
				
			||||||
 | 
					                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,6 +18,10 @@ 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…
	
	Add table
		Add a link
		
	
		Reference in a new issue