summaryrefslogtreecommitdiff
path: root/templates/events.html
diff options
context:
space:
mode:
authorVanja Cosic <1070957+vanjacosic@users.noreply.github.com>2023-10-26 17:45:01 +0200
committerVanja Cosic <1070957+vanjacosic@users.noreply.github.com>2023-10-26 17:45:01 +0200
commite642d1628ce3822e86f0731641034b88ad6e0948 (patch)
treec8399c5d72b8b9a6f7673e7a82ba745272dd76c7 /templates/events.html
parent2316c908a66d44aa0f115777236b416166a9d3d5 (diff)
downloadcph-rust-website-e642d1628ce3822e86f0731641034b88ad6e0948.zip
Initial implementation of event pages
Diffstat (limited to 'templates/events.html')
-rw-r--r--templates/events.html67
1 files changed, 67 insertions, 0 deletions
diff --git a/templates/events.html b/templates/events.html
new file mode 100644
index 0000000..afa9747
--- /dev/null
+++ b/templates/events.html
@@ -0,0 +1,67 @@
+{% extends "base.html" %}
+{% import "macros.html" as macros %}
+
+{% block sidebar %}
+{% set toc = ['upcoming', 'recent', 'past'] %}
+<aside class="toc">
+ {% if section.toc %}{% set toc = section.toc %}{% elif page.toc %}{% set toc = page.toc %}{% endif %}
+ {% if toc %}
+ <div class="toc-sticky">
+ <div class="toc-item">
+ <a href="#events">Events</a>
+ </div>
+ {% for h in toc %}
+ <div class="toc-item-child">
+ <a href="#{{h}}">{{ h | capitalize }}</a>
+ </div>
+ {% endfor %}
+ </div>
+ {% endif %}
+</aside>
+{% endblock sidebar %}
+
+{% block content %}
+<h1 class="title">
+ {{ section.title }}
+</h1>
+
+{{ section.content | safe }}
+
+{% set groups = ['upcoming', 'recent', 'past'] %}
+{% set meetups = load_data(path="events.toml") %}
+
+{% for group in groups %}
+
+ {% if meetups[group] %}
+ <section>
+ <h2 id="{{group}}">{{ group | capitalize }}</h2>
+
+ {% for event in meetups[group] %}
+ {% set event_page = section.pages | filter(attribute="title", value=event.title) | first%}
+
+ {% if event_page %}
+ <a class="event-page-link" href="events/{{ event_page.slug }}">
+ <h3>
+ {{ event_page.title }}
+ </h3>
+ </a>
+ {% else %}
+ <article>
+ <details>
+ <summary>
+ <h3>
+ {{ event.title }}
+ </h3>
+ </summary>
+
+ {{ macros::event_attributes(event=event) }}
+ </details>
+ </article>
+ {% endif %}
+ {% endfor %}
+ </section>
+ {% endif %}
+
+{% endfor %}
+
+{% endblock content %} \ No newline at end of file