This commit is contained in:
parent
45ad243706
commit
79e88ec9c2
2 changed files with 51 additions and 3 deletions
|
@ -1,6 +1,7 @@
|
|||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width">
|
||||
<meta name="description" content="Offizielle Website des iFSR – Informationen, Veranstaltungen und Ressourcen für Studierende der Informatik an der TU Dresden.">
|
||||
<meta name="description"
|
||||
content="Offizielle Website des iFSR – Informationen, Veranstaltungen und Ressourcen für Studierende der Informatik an der TU Dresden.">
|
||||
<link rel="icon" href="{{ "favicon.ico" | relURL }}" type="image/x-icon">
|
||||
<!-- SVG Preload -->
|
||||
<link rel="preload" href="/images/logo.svg" as="image" type="image/svg+xml">
|
||||
|
@ -21,7 +22,7 @@
|
|||
></script>
|
||||
<!-- Darkmode JS -->
|
||||
<script>
|
||||
(function() {
|
||||
(function () {
|
||||
try {
|
||||
const stored = localStorage.getItem("theme");
|
||||
const systemPrefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
||||
|
@ -35,7 +36,46 @@
|
|||
})();
|
||||
</script>
|
||||
<!-- Exo 2 Font -->
|
||||
<link href="https://fonts.googleapis.com/css2?family=Exo+2:wght@400;500;600&display=swap" rel="stylesheet" />
|
||||
<link href="https://fonts.googleapis.com/css2?family=Exo+2:wght@400;500;600&display=swap" rel="stylesheet"/>
|
||||
<title>{{ if .IsHome }}{{ site.Title }}{{ else }}{{ printf "%s | %s" .Title site.Title }}{{ end }}</title>
|
||||
|
||||
<!-- Event Calendar -->
|
||||
<link href='https://cdn.jsdelivr.net/npm/fullcalendar@5/main.min.css' rel='stylesheet'/>
|
||||
<script src='https://cdn.jsdelivr.net/npm/fullcalendar@5/main.min.js'></script>
|
||||
<script src='https://cdn.jsdelivr.net/npm/ical.js@1.4.0/build/ical.min.js'></script>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', async function () {
|
||||
const calendarEl = document.getElementById('calendar');
|
||||
const calendar = new FullCalendar.Calendar(calendarEl, {
|
||||
initialView: 'dayGridMonth'
|
||||
});
|
||||
calendar.render();
|
||||
|
||||
try {
|
||||
const response = await fetch('https://nc.ifsr.de/remote.php/dav/public-calendars/W5Sk7zLD28n6ze44/?export');
|
||||
const icsData = await response.text();
|
||||
|
||||
const jcalData = ICAL.parse(icsData);
|
||||
const comp = new ICAL.Component(jcalData);
|
||||
const events = comp.getAllSubcomponents('vevent');
|
||||
|
||||
const fcEvents = events.map(event => {
|
||||
const icalEvent = new ICAL.Event(event);
|
||||
return {
|
||||
title: icalEvent.summary,
|
||||
start: icalEvent.startDate.toJSDate(),
|
||||
end: icalEvent.endDate.toJSDate(),
|
||||
description: icalEvent.description
|
||||
};
|
||||
});
|
||||
|
||||
calendar.addEventSource(fcEvents);
|
||||
|
||||
} catch (error) {
|
||||
console.error('Fehler beim Laden oder Parsen der ICS-Datei:', error);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
{{ partialCached "head/css.html" . }}
|
||||
{{ partialCached "head/js.html" . }}
|
||||
|
|
8
layouts/events/single.html
Normal file
8
layouts/events/single.html
Normal file
|
@ -0,0 +1,8 @@
|
|||
{{ define "main" }}
|
||||
<div class="container">
|
||||
<div id="markdown">
|
||||
{{ .Content }}
|
||||
</div>
|
||||
<div id='calendar'></div>
|
||||
</div>
|
||||
{{ end }}
|
Loading…
Add table
Add a link
Reference in a new issue