GoBlog/templates/geomap.gohtml

29 lines
881 B
Plaintext

{{ define "title" }}
<title>{{ mdtitle .Blog.Title }}</title>
{{ if not .Data.nolocations }}
<link rel="stylesheet" href="/-/leaflet/leaflet.css"/>
<script src="/-/leaflet/leaflet.js"></script>
{{ end }}
{{ end }}
{{ define "main" }}
<main>
{{ if .Data.nolocations }}
<p>{{ string .Blog.Lang "nolocations" }}</p>
{{ else }}
<div class="p" id="map"
data-locations="{{ .Data.locations }}"
data-tracks="{{ .Data.tracks }}"
data-minzoom={{ .Data.minzoom }}
data-maxzoom={{ .Data.maxzoom }}
data-attribution="{{ .Data.attribution }}"
></div>
<script defer src="{{ asset "js/geomap.js" }}"></script>
{{ end }}
</main>
{{ if .CommentsEnabled }}{{ interactions .Blog .Canonical }}{{ end }}
{{ end }}
{{ define "geomap" }}
{{ template "base" . }}
{{ end }}