From 1fe1d13c600b7dfe421b3b99b833b7d5d1232724 Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Thu, 23 Jul 2026 00:18:21 +0200 Subject: 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. --- assets/static/vendor/leaflet-i18n/leaflet-i18n.js | 41 +++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 assets/static/vendor/leaflet-i18n/leaflet-i18n.js (limited to 'assets/static/vendor/leaflet-i18n') diff --git a/assets/static/vendor/leaflet-i18n/leaflet-i18n.js b/assets/static/vendor/leaflet-i18n/leaflet-i18n.js new file mode 100644 index 0000000..9456214 --- /dev/null +++ b/assets/static/vendor/leaflet-i18n/leaflet-i18n.js @@ -0,0 +1,41 @@ +// Following https://github.com/Leaflet/Leaflet/blob/master/PLUGIN-GUIDE.md +(function (factory, window) { + + // define an AMD module that relies on 'leaflet' + if (typeof define === 'function' && define.amd) { + define(['leaflet'], factory); + + // define a Common JS module that relies on 'leaflet' + } else if (typeof exports === 'object') { + module.exports = factory(require('leaflet')); + } + + // attach your plugin to the global 'L' variable + if (typeof window !== 'undefined' && window.L) { + factory(window.L); + + } +}(function (L) { + L.locales = {}; + L.locale = null; + L.registerLocale = function registerLocale(code, locale) { + L.locales[code] = L.Util.extend({}, L.locales[code], locale); + }; + L.setLocale = function setLocale(code) { + L.locale = code; + }; + return L.i18n = L._ = function translate(string, data) { + if (L.locale && L.locales[L.locale] && typeof L.locales[L.locale][string] !== "undefined") { + string = L.locales[L.locale][string]; + } + try { + // Do not fail if some data is missing + // a bad translation should not break the app + string = L.Util.template(string, data); + } + catch (err) {/*pass*/ + } + + return string; + }; +}, window)); -- cgit v1.3.1