Skip to content

Commit

Permalink
feat(calendar): init calendar
Browse files Browse the repository at this point in the history
  • Loading branch information
Lino committed Apr 21, 2024
1 parent bc7bf80 commit b40e8ae
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 0 deletions.
11 changes: 11 additions & 0 deletions 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
11 changes: 11 additions & 0 deletions 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
3 changes: 3 additions & 0 deletions hugo.toml
Expand Up @@ -12,6 +12,9 @@ timeout = "120s"

disableKinds = ['taxonomy', 'term']

[outputs]
section = ["HTML", "Calendar"]

[module]
replacements = "github.com/colinwilson/lotusdocs -> lotusdocs"
[[module.imports]]
Expand Down
20 changes: 20 additions & 0 deletions 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
27 changes: 27 additions & 0 deletions layouts/index.de.html
@@ -1,3 +1,30 @@
{{ define "main" }}
{{ partial "landing.html" (dict "landingData" .Site.Data.de.landing) }}
<script type='importmap'>
{
"imports": {
"@fullcalendar/core": "https://cdn.skypack.dev/@fullcalendar/core@6.1.11",
"@fullcalendar/daygrid": "https://cdn.skypack.dev/@fullcalendar/daygrid@6.1.11",
"@fullcalendar/icalendar": "https://cdn.skypack.dev/@fullcalendar/icalendar@6.1.11"
}
}
</script>
<script type='module'>
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],
events: {
url: 'http://localhost:1313/de/events/index.ics',
format: 'ics'
}
})
calendar.render()
})
</script>
<div id='calendar'></div>
{{ end }}

0 comments on commit b40e8ae

Please sign in to comment.