From 0755564ef63929f0babab987f6afde859a11bd6f Mon Sep 17 00:00:00 2001 From: svemagie <869694+svemagie@users.noreply.github.com> Date: Fri, 20 Mar 2026 21:32:40 +0100 Subject: [PATCH] feat: conditionally load Leaflet on pages with leafletMap: true --- _includes/layouts/base.njk | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/_includes/layouts/base.njk b/_includes/layouts/base.njk index 2398af8..4467fd8 100644 --- a/_includes/layouts/base.njk +++ b/_includes/layouts/base.njk @@ -131,6 +131,13 @@ {% for social in site.social %} {% endfor %} + + {# Leaflet map — loaded only on pages that set leafletMap: true in front matter #} + {# CSS is synchronous (Leaflet requires CSS before map init); JS is non-deferred (inline init script runs synchronously in body) #} + {% if leafletMap %} + + + {% endif %}