From e642d1628ce3822e86f0731641034b88ad6e0948 Mon Sep 17 00:00:00 2001 From: Vanja Cosic <1070957+vanjacosic@users.noreply.github.com> Date: Thu, 26 Oct 2023 17:45:01 +0200 Subject: Initial implementation of event pages --- content/events.md | 9 ---- content/events/_index.md | 8 ++++ content/events/meetup-39.md | 16 +++++++ content/events/meetup-40.md | 20 +++++++++ static/styles.css | 84 +++++++++++++++++++++++++++++++---- templates/base.html | 6 +-- templates/event-page.html | 28 ++++++++++++ templates/events.html | 67 ++++++++++++++++++++++++++++ templates/macros.html | 42 ++++++++++++++++++ templates/shortcodes/get_event.html | 18 ++++++++ templates/shortcodes/list_events.html | 18 ++++++++ templates/shortcodes/list_events.md | 15 ------- templates/shortcodes/slides_link.html | 5 +++ templates/shortcodes/youtube.html | 11 +++++ 14 files changed, 311 insertions(+), 36 deletions(-) delete mode 100644 content/events.md create mode 100644 content/events/_index.md create mode 100644 content/events/meetup-39.md create mode 100644 content/events/meetup-40.md create mode 100644 templates/event-page.html create mode 100644 templates/events.html create mode 100644 templates/macros.html create mode 100644 templates/shortcodes/get_event.html create mode 100644 templates/shortcodes/list_events.html delete mode 100644 templates/shortcodes/list_events.md create mode 100644 templates/shortcodes/slides_link.html create mode 100644 templates/shortcodes/youtube.html diff --git a/content/events.md b/content/events.md deleted file mode 100644 index 240a8f0..0000000 --- a/content/events.md +++ /dev/null @@ -1,9 +0,0 @@ -+++ -title = "Events" -+++ - -{{ list_events(group="upcoming") }} - -{{ list_events(group="recent") }} - -{{ list_events(group="past") }} diff --git a/content/events/_index.md b/content/events/_index.md new file mode 100644 index 0000000..970bda3 --- /dev/null +++ b/content/events/_index.md @@ -0,0 +1,8 @@ ++++ +title = "Events" +sort_by = "date" +template = "events.html" +page_template = "event-page.html" ++++ + + diff --git a/content/events/meetup-39.md b/content/events/meetup-39.md new file mode 100644 index 0000000..21ec2d3 --- /dev/null +++ b/content/events/meetup-39.md @@ -0,0 +1,16 @@ ++++ +title = "Meetup #39" +date = 2023-08-30 ++++ + +## An introduction to Spin, a serverless WebAssembly framework written in Rust + +by Mikkel Hegnhøj + +{{ youtube(id="xPgmXRg3O0Y") }} + +## Rust embedded at Espressif + +by Scott Mabin + +{{ youtube(id="gdmUhzJfgzk") }} diff --git a/content/events/meetup-40.md b/content/events/meetup-40.md new file mode 100644 index 0000000..5a438a8 --- /dev/null +++ b/content/events/meetup-40.md @@ -0,0 +1,20 @@ ++++ +title = "Meetup #40" +date = 2023-09-28 ++++ + +## Send is not about ownership + +by Alice Ryhl + +{{ youtube(id="eRxqX5_UxaY") }} + +{{ slides_link(title="Link to slides", url="https://docs.google.com/presentation/d/1qut4u-FGMzeW9QRq1ya3EoHHU2qvaJkUlW_3fYV0AtA/") }} + +## impl Trait: look ma', no generics! + +by Jon Gjengset + +{{ youtube(id="CWiz_RtA1Hw") }} + +{{ slides_link(title="Link to slides", url="https://docs.google.com/presentation/d/1U27Yr8MniRMUfxfPlwYt3wkYm6EtTWv42slYGRdgW1M/") }} diff --git a/static/styles.css b/static/styles.css index 2c28d05..31b0c5d 100644 --- a/static/styles.css +++ b/static/styles.css @@ -111,7 +111,7 @@ main h1:first-of-type { } h1 { - font-size: 2rem; + font-size: 2.2rem; font-weight: 500; color: var(--primary-text-color); margin-top: 1.5rem; @@ -119,7 +119,7 @@ h1 { } h2 { - font-size: 1.3rem; + font-size: 1.4rem; font-weight: 500; color: var(--primary-text-color); margin-top: 1.5rem; @@ -196,6 +196,10 @@ aside { overflow: auto; } +.content { + flex-grow: 1; +} + .content pre { overflow-x: auto; padding: 1.25em 1.5em; @@ -250,19 +254,81 @@ aside { opacity: 0.8; } -.page-events h2 { +.section-events h2 { color: var(--secondary-text-color); margin-top: 3rem; + margin-bottom: 1rem; } -.page-events h3 { +.section-events h3 { font-size: 1.5rem; - margin-top: 3rem; - margin-bottom: 0; + margin-top: .5rem; + margin-bottom: .5rem; } -.page-events h2 + h3 { - margin-top: 1.5rem; +.event-page-link { + padding-left: 1rem; +} + +.event-page-link { + display: block; + padding-left: 2rem; +} + +details summary { + cursor: pointer; + width: 100%; + padding-left: 1rem; +} + +details summary:hover { + background: #303030; +} + +details summary > * { + display: inline-block; +} + +details { + padding-left: 1rem; + padding-right: 1rem; +} + +details[open] { + background: #303030; +} + +dl { + padding-left: 2rem; +} + +dt { + font-weight: bold; +} + +dd { + margin-bottom: .5rem; +} + +dd:last-child { + padding-top: 1rem; + margin-left: 0; +} + +.youtube-container { + position: relative; + width: 100%; + height: 0; + padding-bottom: 56.25%; + margin: 1.5rem 0; +} + +.youtube-container iframe { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; } @media screen and (min-width: 768px) { @@ -285,4 +351,4 @@ aside { .toc { display: block; } -} \ No newline at end of file +} diff --git a/templates/base.html b/templates/base.html index 3c435c5..1e1f2d6 100644 --- a/templates/base.html +++ b/templates/base.html @@ -7,14 +7,14 @@ - + {% block header %}
{% endblock header %} -
+
{% block sidebar %} {% endblock sidebar %}
diff --git a/templates/event-page.html b/templates/event-page.html new file mode 100644 index 0000000..d807e31 --- /dev/null +++ b/templates/event-page.html @@ -0,0 +1,28 @@ +{% extends "base.html" %} +{% import "macros.html" as macros %} + +{% block content %} +

+ {{ page.title }} +

+ +{% set meetups = load_data(path="events.toml") %} +{% set upcoming = meetups['upcoming'] %} +{% set all_events = meetups['recent'] | concat(with=upcoming) %} + +{% set event = all_events | filter(attribute="title", value=page.title) | first %} + +{% if event %} +
+ +

Details about this event

+
+ {{ macros::event_attributes(event=event) }} +
+{% else %} + No data found for this event. +{% endif %} + +{{ page.content | safe }} + +{% endblock content %} \ No newline at end of file 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'] %} + +{% endblock sidebar %} + +{% block content %} +

+ {{ section.title }} +

+ +{{ section.content | safe }} + +{% set groups = ['upcoming', 'recent', 'past'] %} +{% set meetups = load_data(path="events.toml") %} + +{% for group in groups %} + + {% if meetups[group] %} +
+

{{ group | capitalize }}

+ + {% for event in meetups[group] %} + {% set event_page = section.pages | filter(attribute="title", value=event.title) | first%} + + {% if event_page %} + +

+ {{ event_page.title }} +

+
+ {% else %} +
+
+ +

+ {{ event.title }} +

+
+ + {{ macros::event_attributes(event=event) }} +
+
+ {% endif %} + {% endfor %} +
+ {% endif %} + +{% endfor %} + +{% endblock content %} \ No newline at end of file diff --git a/templates/macros.html b/templates/macros.html new file mode 100644 index 0000000..47b07e2 --- /dev/null +++ b/templates/macros.html @@ -0,0 +1,42 @@ +{% macro event_attributes(event) %} +
+ {% if event.url %} +
+ Event link +
+
+ {{ event.title}} on Meetup.com +
+ {% endif %} + +
+ Date +
+
+ {% if event.date %} + + {% else %} + (No date found) + {% endif %} +
+ +
+ Venue +
+
+ {% if event.venue %} + {{ event.venue }} – {% endif %} + {% if event.address %}{{ event.address }} + {% else %} + (No venue) + {% endif %} +
+ + {% if event.content -%} +
Description
+
+
{{ event.content | safe }}
+
+ {% endif %} +
+{% endmacro event_attributes %} \ No newline at end of file diff --git a/templates/shortcodes/get_event.html b/templates/shortcodes/get_event.html new file mode 100644 index 0000000..1526685 --- /dev/null +++ b/templates/shortcodes/get_event.html @@ -0,0 +1,18 @@ +{% set meetups = load_data(path="events.toml") %} + +{% if meetups['recent'] %} +## {{ 'recent' | capitalize }} + +{% for item in meetups['recent'] %} +### {{ item.title }} + +{% if item.event_page %}yo{% endif %} + +{% if item.url %}**Link:** [Meetup.com]({{ item.url }}){% endif %} +**Date:** {% if item.date %} {% else %}(No date found) {% endif %} +**Venue:** {% if item.venue %}{{ item.venue }} – {% endif %}{% if item.address %}{{ item.address }} {% else %}(No venue) {% endif %} +{% if item.content -%}**Description:**
{{ item.content | safe }}
{% endif %} + +{% endfor %} +{% endif %} + diff --git a/templates/shortcodes/list_events.html b/templates/shortcodes/list_events.html new file mode 100644 index 0000000..aa59de8 --- /dev/null +++ b/templates/shortcodes/list_events.html @@ -0,0 +1,18 @@ +{% set meetups = load_data(path="events.toml") %} + +{% if meetups[group] %} +## {{ group | capitalize }} + +{% for item in meetups[group] %} +### {{ item.title }} + +{% if item.event_page %}yo{% endif %} + +{% if item.url %}**Link:** [Meetup.com]({{ item.url }}){% endif %} +**Date:** {% if item.date %} {% else %}(No date found) {% endif %} +**Venue:** {% if item.venue %}{{ item.venue }} – {% endif %}{% if item.address %}{{ item.address }} {% else %}(No venue) {% endif %} +{% if item.content -%}**Description:**
{{ item.content | safe }}
{% endif %} + +{% endfor %} +{% endif %} + diff --git a/templates/shortcodes/list_events.md b/templates/shortcodes/list_events.md deleted file mode 100644 index 1b887c7..0000000 --- a/templates/shortcodes/list_events.md +++ /dev/null @@ -1,15 +0,0 @@ -{% set meetups = load_data(path="events.toml") %} - -{% if meetups[group] %} -## {{ group | capitalize }} - -{% for item in meetups[group] %} -### {{ item.title }} - -{% if item.url %}**Link:** [Meetup.com]({{ item.url }}){% endif %} -**Date:** {% if item.date %} {% else %}(No date found) {% endif %} -**Venue:** {% if item.venue %}{{ item.venue }} – {% endif %}{% if item.address %}{{ item.address }} {% else %}(No venue) {% endif %} -{% if item.content -%}**Description:**
{{ item.content | safe }}
{% endif %} - -{% endfor %} -{% endif %} diff --git a/templates/shortcodes/slides_link.html b/templates/shortcodes/slides_link.html new file mode 100644 index 0000000..49271ff --- /dev/null +++ b/templates/shortcodes/slides_link.html @@ -0,0 +1,5 @@ + + {{title}} + \ No newline at end of file diff --git a/templates/shortcodes/youtube.html b/templates/shortcodes/youtube.html new file mode 100644 index 0000000..573e269 --- /dev/null +++ b/templates/shortcodes/youtube.html @@ -0,0 +1,11 @@ +
+ +
-- cgit v1.2.3