mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-20 00:14:48 +00:00
feat(map): add open-source map block (MapLibre GL + OpenFreeMap)
Single-location + multi-marker, side-by-side and map-only layouts. Zero-config — no API key. MapLibre is vendored via vite and loaded conditionally when a page contains a map block. Provider resolution is a single switchable function so other tile providers can be added later without changing the block contract.
This commit is contained in:
1 parent
f107371dc2
commit
4de0ad0af9
12 files changed
+518
-2
No files matched your search
@@ -1,3 +1,11 @@
|
||||
{{/* MapLibre GL — load before Preact block scripts so window.maplibregl is available when the map block hydrates */}}
|
||||
{{ if .Page.Store.Get "has_map" }}
|
||||
{{ $maplibre_css := resources.Get "dist/lib/maplibre/maplibre-gl.css" | resources.Fingerprint "sha256" }}
|
||||
<link rel="stylesheet" href="{{ $maplibre_css.RelPermalink }}" integrity="{{ $maplibre_css.Data.Integrity }}" />
|
||||
{{ $maplibre_js := resources.Get "dist/lib/maplibre/maplibre-gl.js" | resources.Fingerprint "sha256" }}
|
||||
<script defer src="{{ $maplibre_js.RelPermalink }}" integrity="{{ $maplibre_js.Data.Integrity }}"></script>
|
||||
{{ end }}
|
||||
|
||||
{{/* Load Preact for component-based blocks */}}
|
||||
{{/* Check if any blocks on this page use Preact (set by init.html) */}}
|
||||
{{ if .Page.Store.Get "needs_preact" }}
|
||||
|
||||
Reference in new issue
Block a user