Skip to content

Commit

Permalink
Merge pull request #28 from netz39/6-page-veranstaltungenkalender
Browse files Browse the repository at this point in the history
Add built-in calender by using fullcalendar.io
  • Loading branch information
MG-5 committed Oct 20, 2023
2 parents 20034a3 + 7002f2b commit 6cddb2e
Show file tree
Hide file tree
Showing 9 changed files with 105 additions and 1 deletion.
4 changes: 4 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ collections:
portfolio:
output: true
permalink: /:collection/:name
events:
output: true
permalink: /events/:path
title: Events

# BUILD SETTINGS
sass:
Expand Down
7 changes: 7 additions & 0 deletions _events/stammtisch_kw42.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
layout: event
title: "Stammtisch KW42"
event_date: 2023-10-18
---

Heute ist Stammtisch!
33 changes: 33 additions & 0 deletions _layouts/event.liquid
Original file line number Diff line number Diff line change
@@ -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>
1 change: 0 additions & 1 deletion _sass/base/_global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ table {
word-wrap: break-word;
table-layout: fixed;
width: 100%;
display: inline-block;
}

td,
Expand Down
6 changes: 6 additions & 0 deletions assets/js/vendor/fullcalendar/de.global.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions assets/js/vendor/fullcalendar/index.global.min.js

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions calendar-data.html
Original file line number Diff line number Diff line change
@@ -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 changes: 32 additions & 0 deletions pages/01_events.md
Original file line number Diff line number Diff line change
@@ -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>
File renamed without changes.

0 comments on commit 6cddb2e

Please sign in to comment.