Merge pull request #28 from netz39/6-page-veranstaltungenkalender

Add built-in calender by using fullcalendar.io
This commit is contained in:
Max 2023-10-20 19:13:00 +02:00 committed by GitHub
commit 6dfce388c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 105 additions and 1 deletions

View file

@ -46,6 +46,10 @@ collections:
portfolio: portfolio:
output: true output: true
permalink: /:collection/:name permalink: /:collection/:name
events:
output: true
permalink: /events/:path
title: Events
# BUILD SETTINGS # BUILD SETTINGS
sass: sass:

View file

@ -0,0 +1,7 @@
---
layout: event
title: "Stammtisch KW42"
event_date: 2023-10-18
---
Heute ist Stammtisch!

33
_layouts/event.liquid Normal file
View file

@ -0,0 +1,33 @@
---
layout: default
---
<article {% if page.feature-img or page.color %}class="feature-image" {% endif %}>
<header id="main" style="">
<div class="title-padder">
{% if page.hide_title %}
<div class="feature-image-padding"></div>
{% else %}
<h1 id="{{ page.title | cgi_escape }}" class="title">{{ page.title }}</h1>
{% include blog/post_info.liquid author=page.author date=page.event_date %}
{% endif %}
</div>
</header>
<section class="post-content">
{% if page.bootstrap %}
<div class="bootstrap-iso">
{% endif %}
{{ content }}
{% if page.bootstrap %}
</div>
{% endif %}
</section>
<!-- Social media shares -->
{% include social/share_buttons.liquid %}
<!-- Tag list -->
{% capture tag_list %}{{ page.tags | join: "|"}}{% endcapture %}
{% include default/tags_list.liquid tags=tag_list %}
</article>

View file

@ -157,7 +157,6 @@ table {
word-wrap: break-word; word-wrap: break-word;
table-layout: fixed; table-layout: fixed;
width: 100%; width: 100%;
display: inline-block;
} }
td, td,

View file

@ -0,0 +1,6 @@
/*!
FullCalendar Core v6.1.9
Docs & License: https://fullcalendar.io
(c) 2023 Adam Shaw
*/
!function(e){"use strict";function t(e){return"Tag"===e||"Monat"===e?"r":"Jahr"===e?"s":""}var n={code:"de",week:{dow:1,doy:4},buttonText:{prev:"Zurück",next:"Vor",today:"Heute",year:"Jahr",month:"Monat",week:"Woche",day:"Tag",list:"Terminübersicht"},weekText:"KW",weekTextLong:"Woche",allDayText:"Ganztägig",moreLinkText:e=>"+ weitere "+e,noEventsText:"Keine Ereignisse anzuzeigen",buttonHints:{prev:e=>`Vorherige${t(e)} ${e}`,next:e=>`Nächste${t(e)} ${e}`,today:e=>"Tag"===e?"Heute":`Diese${t(e)} ${e}`},viewHint:e=>e+("Woche"===e?"n":"Monat"===e?"s":"es")+"ansicht",navLinkHint:"Gehe zu $0",moreLinkHint:e=>"Zeige "+(1===e?"ein weiteres Ereignis":e+" weitere Ereignisse"),closeHint:"Schließen",timeHint:"Uhrzeit",eventHint:"Ereignis"};FullCalendar.globalLocales.push(n)}();

File diff suppressed because one or more lines are too long

17
calendar-data.html Normal file
View file

@ -0,0 +1,17 @@
---
layout:
title:
permalink: /calendar-data/
---
[
{% for event in site.events %}
{
"title":"{{event.title}}",
"start": "{{event.event_date}}",
"allDay":true,
"url":"{{event.url}}"
}
{%unless forloop.last %},{%endunless%}
{% endfor %}
]

32
pages/01_events.md Normal file
View file

@ -0,0 +1,32 @@
---
layout: default
title: Events
permalink: /events
icon: "far fa-calendar"
---
<center>
<h2 class="title"> <i class="far fa-calendar"></i> Events </h2>
</center>
<html lang='de'>
<head>
<meta charset='utf-8' />
<script src='/assets/js/vendor/fullcalendar/index.global.min.js'></script>
<script src='/assets/js/vendor/fullcalendar/de.global.min.js'></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
var calendarEl = document.getElementById('calendar');
var calendar = new FullCalendar.Calendar(calendarEl, {
initialView: 'dayGridMonth', height: "auto", locale: 'de', events: '/calendar-data'
});
calendar.render();
});
</script>
</head>
<body>
<div id='calendar' style="width:80%; margin: auto;"></div>
</body>
</html>