diff options
| author | 2025-08-11 16:52:48 +0700 | |
|---|---|---|
| committer | 2025-08-11 16:52:48 +0700 | |
| commit | ea1f83df820baa14dcd904d581ab2bb0976b172d (patch) | |
| tree | 61322010ecdd59534cc1d02ff1c29d815d07152c /views/pages/blog-page.html | |
| parent | 15356da2c3e3544d757591a2f6e68367bf2d137f (diff) | |
| download | web-ea1f83df820baa14dcd904d581ab2bb0976b172d.tar.gz web-ea1f83df820baa14dcd904d581ab2bb0976b172d.zip | |
feat: redo blog catalogue with same layout as blog-pagev0.5.0
feat: implement localization
feat: filters and sort in blog catalogue
feat: one-page search
feat: ram theme
refactor: generate blog catalogue and blog page out of one layout
refactor: have one layout for both mobile & desktop (aspect ratio dependable)
refactor: use own template manager to use templates separately
Diffstat (limited to 'views/pages/blog-page.html')
| -rw-r--r-- | views/pages/blog-page.html | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/views/pages/blog-page.html b/views/pages/blog-page.html new file mode 100644 index 0000000..5f001d6 --- /dev/null +++ b/views/pages/blog-page.html @@ -0,0 +1,70 @@ +{{ define "header" }} +<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/lightgallery/2.8.3/css/lightgallery.min.css"> +<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/lightgallery/2.8.3/css/lg-zoom.min.css"> +<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/lightgallery/2.8.3/css/lg-thumbnail.min.css"> +{{- if .MapLocationX }} +<link rel="stylesheet" href="https://f003.backblazeb2.com/file/sayana-static/libs/leaflet/1.9.4/leaflet.css"> +{{- end }} + +<style> + .map-container .leaflet-container { + width: 100% !important; + height: 100% !important; + } +</style> +{{ end }} + +{{ define "body" }} +<div class="bg-background-light flex flex-col grow overflow-y-auto inset-shadow p-[2.4vmin] ar-lt-0.8:max-h-[80%]"> + {{ .ParsedMarkdown }} +{{- if .MapLocationX }} + <hr class="border-t-4 border-dotted border-main-dark mt-[0.8vmin] mb-[0.8vmin] w-[80%] ml-auto mr-auto"> + <div id="location-map" class="relative p-[0.8vmin] flex-none ml-auto mr-auto w-[60%] h-[40vh]"></div> + <hr class="border-t-4 border-dotted border-main-dark mt-[0.8vmin] mb-[0.8vmin] w-[80%] ml-auto mr-auto"> +{{- end }} +</div> +{{ end }} + +{{ define "footer" }} +<script src="https://f003.backblazeb2.com/file/sayana-static/libs/lightgallery/2.8.3/lightgallery.min.js"></script> +<script src="https://f003.backblazeb2.com/file/sayana-static/libs/lightgallery/2.8.3/plugins/lg-zoom.min.js"></script> +<script src="https://f003.backblazeb2.com/file/sayana-static/libs/lightgallery/2.8.3/plugins/lg-thumbnail.min.js"></script> +{{- if .MapLocationX }} +<script src="https://f003.backblazeb2.com/file/sayana-static/libs/leaflet/1.9.4/leaflet.js"></script> + +<script> + function initLocationMap(id, x, y, relativeErrorMeters = 0) { + var map = L.map(id).setView([x, y], 13); + + L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', { + maxZoom: 19, + attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>' + }).addTo(map); + + if (relativeErrorMeters != 0) { + var circle = L.circle([x, y], { + color: '#8a9d8a', + fillColor: '#8a9d8a', + fillOpacity: 0.15, + radius: relativeErrorMeters + }).addTo(map); + } + + var marker = L.marker([x, y]).addTo(map); + } + + document.addEventListener('DOMContentLoaded', () => {initLocationMap( + 'location-map', + {{ .MapLocationX }}, + {{ .MapLocationY }}, + {{ .MapLocationAreaMeters }} + )}); + + window.addEventListener('resize', function() { + setTimeout(() => { + if (window.location-map) window.location-map.invalidateSize(); + }, 100); + }); +</script> +{{- end }} +{{ end }}
\ No newline at end of file |