-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(events): add calendar and single event pages
- Loading branch information
Showing
18 changed files
with
343 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { Calendar } from '@fullcalendar/core' | ||
import dayGridPlugin from '@fullcalendar/daygrid' | ||
import iCalendarPlugin from '@fullcalendar/icalendar' | ||
import deLocale from '@fullcalendar/core/locales/de' | ||
|
||
document.addEventListener('DOMContentLoaded', function () { | ||
const calendarEl = document.getElementById('calendar') | ||
const calendar = new Calendar(calendarEl, { | ||
plugins: [dayGridPlugin, iCalendarPlugin], | ||
eventDisplay: 'block', | ||
contentHeight: 'auto', | ||
eventSources: [ | ||
{ | ||
url: 'index.ics', | ||
format: 'ics' | ||
} | ||
] | ||
}) | ||
if (document.documentElement.lang === 'de') { | ||
calendar.setOption('locale', deLocale) | ||
} | ||
calendar.render() | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
title: "Events" | ||
description: "Ein Überblick der Freifunk-Events in der nächsten Zeit. Komm gerne vorbei." | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
title: "Events" | ||
description: "An overview of Freifunk events in the near future. Feel free to drop by." | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
outputs: | ||
- html | ||
- calendar | ||
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" | ||
--- | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
outputs: | ||
- html | ||
- calendar | ||
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" | ||
--- | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{{ define "main" }} | ||
<div class="container mt-100 mt-60"> | ||
<style> | ||
.fc-daygrid-event { | ||
white-space: break-spaces; | ||
} | ||
.fc-event-main-frame { | ||
flex-direction: column; | ||
} | ||
</style> | ||
<div class="justify-content-center mx-auto col-sm-6"> | ||
<div id='calendar' class="mb-4"></div> | ||
{{ $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 }} | ||
<script src="{{ $js.RelPermalink }}" defer></script> | ||
{{ with .OutputFormats.Get "calendar" -}} | ||
<a href="{{ .Permalink | safeURL }}">ical feed</a> | ||
{{- end }} | ||
</div> | ||
</div> | ||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
BEGIN:VCALENDAR | ||
VERSION:2.0 | ||
PRODID:-//freifunk berlin//hugo wegbsite generator//EN | ||
CALSCALE:GREGORIAN | ||
{{range .Pages -}} | ||
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" "" }} | ||
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 -}} | ||
END:VCALENDAR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{{ define "main" }} | ||
<section id="{{ .Title }}" class="container mt-100 mt-60"> | ||
<div class="justify-content-center mx-auto col-sm-6"> | ||
<h1 class="title fw-bold mb-4"> | ||
<span class="material-icons" | ||
style="font-size: inherit; | ||
line-height: inherit; | ||
vertical-align:bottom">calendar_month</span> | ||
{{ .Title }} | ||
{{ if not .Params.rrule }} | ||
<span style="color:grey;white-space:nowrap;"> | ||
{{ time.Format "02 Jan 2006" .Params.start }} | ||
</span> | ||
{{ end }} | ||
</h1> | ||
<div class="d-flex flex-wrap"> | ||
<p class="text-muted para-desc mb-2 mx-auto">{{ .Content | markdownify }}</p> | ||
<div> | ||
<div class="p-4 mb-4 bg-soft-primary rounded"> | ||
<div class="row"> | ||
<span class="material-icons align-middle col-2">location_on</span> | ||
<p class="col-8">{{ .Params.location }}</p> | ||
</div> | ||
{{ if .Params.rrule }} | ||
<div class="row"> | ||
<span class="material-icons align-middle col-2">schedule</span> | ||
<p class="col-8"> | ||
{{ time.Format "15:04" .Params.start }} - {{ time.Format "15:04" .Params.end }} | ||
</p> | ||
</div> | ||
<div class="row"> | ||
<span class="material-icons align-middle col-2">event_repeat</span> | ||
<p class="col-8">{{ .Params.rrule_text }}</p> | ||
</div> | ||
{{ else }} | ||
<div class="row"> | ||
<span class="material-icons align-middle col-2">schedule</span> | ||
<p class="col-8"> | ||
{{ time.Format "2 Jan 2006 15:04" .Params.start }} | ||
<br> | ||
- {{ time.Format "2 Jan 2006 15:04" .Params.end }} | ||
</p> | ||
</div> | ||
{{ end }} | ||
</div> | ||
{{ with .OutputFormats.Get "calendar" -}} | ||
<a href="{{ .Permalink | safeURL }}">ical feed</a> | ||
{{- end }} | ||
</div> | ||
</div> | ||
</div> | ||
</section> | ||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
Oops, something went wrong.