diff options
| author | Dennis Fink | 2026-07-23 00:18:21 +0200 |
|---|---|---|
| committer | Dennis Fink | 2026-07-23 00:18:21 +0200 |
| commit | 1fe1d13c600b7dfe421b3b99b833b7d5d1232724 (patch) | |
| tree | 2e8636160cc1719c907be56f5ef8cbc7e0f10a53 /templates/blog.html | |
| parent | ca77de06be474dfd712402c327dc436864d233a3 (diff) | |
| download | dennisfink.me-1fe1d13c600b7dfe421b3b99b833b7d5d1232724.tar.gz dennisfink.me-1fe1d13c600b7dfe421b3b99b833b7d5d1232724.zip | |
Add GPX trail maps to blog posts
This adds a trail flow block so posts can include attached GPX files as
interactive maps with route display, elevation charts, activity
summaries, and start/finish markers.
The trail assets are loaded only when needed, keeping the shared
templates clean while vendoring the Leaflet dependencies required for
offline, self-hosted map rendering.
Diffstat (limited to 'templates/blog.html')
| -rw-r--r-- | templates/blog.html | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/templates/blog.html b/templates/blog.html index 4c011a1..3e187cb 100644 --- a/templates/blog.html +++ b/templates/blog.html @@ -2,6 +2,18 @@ {% from "macros/blog.html" import render_blog_index %} +{% set features = namespace(trail=false) %} + +{% for post in this.pagination.items %} + {% for block in post.body.blocks %} + {% if block._flowblock == "trail" %} + {% set features.trail = true %} + {% endif %} + {% endfor %} +{% endfor %} + +{% set needs_trail_assets = features.trail %} + {% block meta %} {{ super() }} <meta property="og:type" content="website"> |
