Skip to content

Commit

Permalink
feat(calendar): create layout for events page
Browse files Browse the repository at this point in the history
  • Loading branch information
noxilixon committed Aug 20, 2024
1 parent 59c240c commit be524df
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 31 deletions.
31 changes: 0 additions & 31 deletions content/events.de.md

This file was deleted.

4 changes: 4 additions & 0 deletions content/events/_index.de.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: "Events"
calendars: ["index.ics", "https://www.c-base.org/calendar/exported/regulars.ics"]
---
42 changes: 42 additions & 0 deletions layouts/events/list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{{ define "main" }}
<div class="container mt-100 mt-60">
<div class="justify-content-center mx-auto col-sm-6">
<script type='importmap'>
{
"imports": {
"@fullcalendar/core": "https://cdn.skypack.dev/@fullcalendar/[email protected]",
"@fullcalendar/daygrid": "https://cdn.skypack.dev/@fullcalendar/[email protected]",
"@fullcalendar/icalendar": "https://cdn.skypack.dev/@fullcalendar/[email protected]"
}
}
</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],

eventSources: [
{{- range .Params.Calendars }}

{
url: "{{ . }}",
format: 'ics'
},
{{- end }}
]


})
calendar.render()
})
</script>
<div id='calendar'></div>
<a href="index.ics">ical Feed</a>
</div>
</div>
{{ end }}

0 comments on commit be524df

Please sign in to comment.