diff options
| author | 2026-03-30 02:13:49 +0700 | |
|---|---|---|
| committer | 2026-03-30 02:13:49 +0700 | |
| commit | 8d0385546b0a5f4f3b0832fce1b4c0a10fa0a927 (patch) | |
| tree | 3be8adf291fecb7611adce3d5ed610f8ac832ca2 /views | |
| parent | 56d333f3501cfc8e5725784e29ea917d347f37d8 (diff) | |
| parent | 52fbb4a4eb781dd4ba66fae0e1ceaec6721758f5 (diff) | |
| download | web-0.12.3.tar.gz web-0.12.3.zip | |
v0.12.3 (#24)v0.12.3
* [feat: add meta for embeds & search
engines](https://github.com/SayaAndy/saya-today-web/commit/610341bc9d59f9724e8e71f663b28df1904cb038)
* feat: link marker fill saturation and brightness in the global map to
the publication date
* [feat: add namespace parameter for
gallery](https://github.com/SayaAndy/saya-today-web/commit/52fbb4a4eb781dd4ba66fae0e1ceaec6721758f5)
* refactor: replace sprintf for galleryid with simple replaceall in
gallery rendering
Diffstat (limited to 'views')
| -rw-r--r-- | views/layouts/general-page.html | 3 | ||||
| -rw-r--r-- | views/pages/global-map.html | 29 | ||||
| -rw-r--r-- | views/pages/unsubscribe-page.html | 1 |
3 files changed, 18 insertions, 15 deletions
diff --git a/views/layouts/general-page.html b/views/layouts/general-page.html index 01043c6..3f5bcfd 100644 --- a/views/layouts/general-page.html +++ b/views/layouts/general-page.html @@ -3,6 +3,9 @@ <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> + {{- range $k, $v := .Meta }} + <meta name="{{ $k }}" content="{{ $v }}"> + {{- end }} <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css"> <link rel="stylesheet" href="https://f003.backblazeb2.com/file/sayana-static/libs/leaflet/1.9.4/leaflet.css"> <link rel="stylesheet" href="https://f003.backblazeb2.com/file/sayana-static/libs/glightbox/3.3.0/css/glightbox.min.css"> diff --git a/views/pages/global-map.html b/views/pages/global-map.html index 7d788d6..4b07bd2 100644 --- a/views/pages/global-map.html +++ b/views/pages/global-map.html @@ -3,6 +3,8 @@ <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <meta name="og:title" content="{{ .L.GlobalMap.Header }}"> + <meta name="og:description" content="{{ .L.GlobalMap.Description }}"> <title>{{ .L.GlobalMap.Header }} // SAYA TODAY</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css"> {{ block "header" . }}{{ end }} @@ -243,35 +245,32 @@ map.addLayer(markers); } - function stringToColor(str) { + function markerToHsl(str, newCoef) { let hash = 0; - for (let i = 0; i < str.length; i++) { + for (let i = 0; i < str.length / 2; i++) { hash = str.charCodeAt(i) + ((hash << 5) - hash); + hash = str.charCodeAt(str.length - i - 1) + ((hash << 5) - hash); + hash %= 360; } - let color = '#'; - for (let i = 0; i < 3; i++) { - const value = (hash >> (i * 8)) & 0xFF; - color += ('00' + value.toString(16)).substr(-2); - } - - return color; + return [hash, (20 + newCoef * 80).toFixed(0), (20 + newCoef * 75).toFixed(0)]; } - function mapAddMarker(x, y, relativeErrorMeters = 0, title = "", link = "", thumbnail = "") { - const titleColor = stringToColor(title); + function mapAddMarker(x, y, relativeErrorMeters = 0, title = "", link = "", thumbnail = "", newCoef = 1) { + const [h, s, l] = markerToHsl(title, newCoef); + const color = `hsl(${h} ${s}% ${l}%)`; if (relativeErrorMeters != 0) { var circle = L.circle([x, y], { - color: titleColor, - fillColor: titleColor, + color: color, + fillColor: color, fillOpacity: 0.15, radius: relativeErrorMeters }).addTo(map); } var marker = L.marker([x, y], { - icon: createCustomIcon(titleColor), + icon: createCustomIcon(color), title: title, }).bindPopup(` <div class="flex flex-row justify-center justify-items-center"> @@ -285,7 +284,7 @@ document.addEventListener('DOMContentLoaded', () => { initLocationMap(); {{- range .MapMarkers }} - mapAddMarker({{ .Lat }}, {{ .Long }}, {{ .AccuracyMeters }}, {{ .Title }}, {{ .PageLink }}, {{ .Thumbnail }}); + mapAddMarker({{ .Lat }}, {{ .Long }}, {{ .AccuracyMeters }}, {{ .Title }}, {{ .PageLink }}, {{ .Thumbnail }}, {{ fdiv .Index (len $.MapMarkers) }}); {{- end }} }); diff --git a/views/pages/unsubscribe-page.html b/views/pages/unsubscribe-page.html index 3876818..c1db9d6 100644 --- a/views/pages/unsubscribe-page.html +++ b/views/pages/unsubscribe-page.html @@ -3,6 +3,7 @@ <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <meta name="robots" content="noindex,nofollow"> <title>{{ .L.UnsubscribePage.Header }} // SAYA TODAY</title> <style> html { |