diff options
| author | 2026-03-30 02:13:49 +0700 | |
|---|---|---|
| committer | 2026-03-30 02:13:49 +0700 | |
| commit | 8d0385546b0a5f4f3b0832fce1b4c0a10fa0a927 (patch) | |
| tree | 3be8adf291fecb7611adce3d5ed610f8ac832ca2 | |
| 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
| -rw-r--r-- | internal/frontmatter/parser.go | 19 | ||||
| -rw-r--r-- | internal/glightbox/block.go | 5 | ||||
| -rw-r--r-- | internal/glightbox/html_renderer.go | 47 | ||||
| -rw-r--r-- | internal/glightbox/parser.go | 9 | ||||
| -rw-r--r-- | internal/router/basic-handler.go | 6 | ||||
| -rw-r--r-- | internal/router/handlers/lang-blog-title.go | 14 | ||||
| -rw-r--r-- | internal/router/handlers/lang-map.go | 8 | ||||
| -rw-r--r-- | internal/router/handlers/lang-user.go | 7 | ||||
| -rw-r--r-- | internal/router/handlers/lang.go | 8 | ||||
| -rw-r--r-- | internal/router/handlers/root.go | 7 | ||||
| -rw-r--r-- | internal/router/router.go | 12 | ||||
| -rw-r--r-- | internal/templatemanager/templatemanager.go | 3 | ||||
| -rw-r--r-- | locale/localization.en.yaml | 2 | ||||
| -rw-r--r-- | locale/localization.go | 4 | ||||
| -rw-r--r-- | locale/localization.ru.yaml | 2 | ||||
| -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 |
18 files changed, 131 insertions, 55 deletions
diff --git a/internal/frontmatter/parser.go b/internal/frontmatter/parser.go index 83312dc..6062113 100644 --- a/internal/frontmatter/parser.go +++ b/internal/frontmatter/parser.go @@ -9,15 +9,16 @@ import ( ) type Metadata struct { - Title string `yaml:"title"` - ShortDescription string `yaml:"shortDescription"` - ActionDate string `yaml:"actionDate"` - PublishedTime time.Time `yaml:"publishedTime"` - Thumbnail string `yaml:"thumbnail"` - Tags []string `yaml:"tags"` - Geolocation string `yaml:"geolocation"` - Medley string `yaml:"medley"` - MedleyPart int `yaml:"medleyPart"` + Title string `yaml:"title"` + ShortDescription string `yaml:"shortDescription"` + ActionDate string `yaml:"actionDate"` + PublishedTime time.Time `yaml:"publishedTime"` + Thumbnail string `yaml:"thumbnail"` + Tags []string `yaml:"tags"` + Geolocation string `yaml:"geolocation"` + Medley string `yaml:"medley"` + MedleyPart int `yaml:"medleyPart"` + ContentSettings map[string]string `yaml:"contentSettings"` } func ParseFrontmatter(content []byte) (metadata *Metadata, markdown []byte, err error) { diff --git a/internal/glightbox/block.go b/internal/glightbox/block.go index e53e67b..30cda1c 100644 --- a/internal/glightbox/block.go +++ b/internal/glightbox/block.go @@ -9,8 +9,9 @@ import ( // GLightboxBlock represents a light gallery block in the AST type GLightboxBlock struct { ast.BaseBlock - Images []GLightboxImage - Location *time.Location + Images []GLightboxImage + Location *time.Location + Namespace string } type GLightboxImage struct { diff --git a/internal/glightbox/html_renderer.go b/internal/glightbox/html_renderer.go index b7b256a..ac34880 100644 --- a/internal/glightbox/html_renderer.go +++ b/internal/glightbox/html_renderer.go @@ -68,7 +68,8 @@ func (r *GLightboxHTMLRenderer) renderGLightbox(w util.BufWriter, source []byte, var elements []string for i, img := range gallery.Images { - imageUrlSegments := strings.Split(img.URL, ".") + fullImageUrl := gallery.Namespace + img.URL + imageUrlSegments := strings.Split(fullImageUrl, ".") imageUrlWithoutExt := strings.Join(imageUrlSegments[:len(imageUrlSegments)-1], ".") imageUrlParts := strings.Split(imageUrlWithoutExt, "/") imageNameParts := strings.Split(imageUrlParts[len(imageUrlParts)-1], "-") @@ -122,7 +123,7 @@ func (r *GLightboxHTMLRenderer) renderGLightbox(w util.BufWriter, source []byte, </picture> <span class="grid-tooltip-text"><p>%s</p></span> <span class="grid-item-index">%d</span> - </a>`, img.URL, strings.Join(tagClassList, " "), galleryID, dayDate.Format("2006-01-02 15:04:05 -07:00"), dataDescriptionAttribute, imageUrlWithoutExt, imageUrlWithoutExt, imageUrlWithoutExt, imageUrlWithoutExt, imageUrlWithoutExt, imageUrlWithoutExt, anchorlessCaptionHTML, i+1)) + </a>`, fullImageUrl, strings.Join(tagClassList, " "), galleryID, dayDate.Format("2006-01-02 15:04:05 -07:00"), dataDescriptionAttribute, imageUrlWithoutExt, imageUrlWithoutExt, imageUrlWithoutExt, imageUrlWithoutExt, imageUrlWithoutExt, imageUrlWithoutExt, anchorlessCaptionHTML, i+1)) if glightboxDescId != "" { elements = append(elements, fmt.Sprintf(` @@ -132,43 +133,43 @@ func (r *GLightboxHTMLRenderer) renderGLightbox(w util.BufWriter, source []byte, } } - w.WriteString(fmt.Sprintf(` + w.WriteString(strings.ReplaceAll(` <div class="items-center flex flex-col"> <hr class="border-t-3 border-dotted border-main-hard mt-1 mb-2 w-[80%%] ml-auto mr-auto"> - <div class="grid masonry-grid-%s"> - <div class="grid-sizer grid-sizer-%s"></div> - %s + <div class="grid masonry-grid-{id}"> + <div class="grid-sizer grid-sizer-{id}"></div> + `+strings.Join(elements, "\n")+` </div> <hr class="border-t-3 border-dotted border-main-hard mt-1 mb-2 w-[80%%] ml-auto mr-auto"> -</div>`, galleryID, galleryID, strings.Join(elements, "\n"))) +</div> - w.WriteString(fmt.Sprintf(` <script> - var pckry_%s = new Packery('.masonry-grid-%s', { - itemSelector: '.grid-item-%s', - columnWidth: '.grid-sizer-%s', + var pckry_{id} = new Packery('.masonry-grid-{id}', { + itemSelector: '.grid-item-{id}', + columnWidth: '.grid-sizer-{id}', percentPosition: false }); - var imgLoad_%s_timer; - var imgLoad_%s = imagesLoaded('.masonry-grid-%s'); + var imgLoad_{id}_timer; + var imgLoad_{id} = imagesLoaded('.masonry-grid-{id}'); - function initMasonryLayout_%s(tm) { - clearTimeout(imgLoad_%s_timer); - imgLoad_%s_timer = setTimeout(() => pckry_%s.layout(), 100); + function initMasonryLayout_{id}(tm) { + clearTimeout(imgLoad_{id}_timer); + imgLoad_{id}_timer = setTimeout(() => pckry_{id}.layout(), 100); } - imgLoad_%s.on('progress', initMasonryLayout_%s); + imgLoad_{id}.on('progress', initMasonryLayout_{id}); - window.addEventListener('resize', initMasonryLayout_%s); + window.addEventListener('resize', initMasonryLayout_{id}); document.addEventListener('popout', (e) => { - window.removeEventListener('resize', initMasonryLayout_%s); - imgLoad_%s.off('progress', initMasonryLayout_%s); - initMasonryLayout_%s = null; - imgLoad_%s = null; + window.removeEventListener('resize', initMasonryLayout_{id}); + imgLoad_{id}.off('progress', initMasonryLayout_{id}); + initMasonryLayout_{id} = null; + imgLoad_{id} = null; }, {once: true}); -</script>`, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID, galleryID)) +</script> +`, "{id}", galleryID)) } return ast.WalkContinue, nil diff --git a/internal/glightbox/parser.go b/internal/glightbox/parser.go index 6780090..b376034 100644 --- a/internal/glightbox/parser.go +++ b/internal/glightbox/parser.go @@ -29,7 +29,7 @@ func (p *GLightboxParser) Open(parent ast.Node, reader text.Reader, pc parser.Co return nil, parser.NoChildren } - r := regexp.MustCompile(`^\{Gallery:([A-Za-z0-9\+\-/]+)\}$`) + r := regexp.MustCompile(`^\{Gallery:([A-Za-z0-9\+\-/]+)(:([A-Za-z0-9\+\-/]+))?\}$`) trimmed := bytes.TrimSpace(line) parts := r.FindSubmatch(trimmed) @@ -44,7 +44,12 @@ func (p *GLightboxParser) Open(parent ast.Node, reader text.Reader, pc parser.Co return nil, parser.NoChildren } - return &GLightboxBlock{Location: loc}, parser.NoChildren + ns := "" + if len(parts) >= 4 { + ns = string(parts[3]) + } + + return &GLightboxBlock{Location: loc, Namespace: ns}, parser.NoChildren } func (p *GLightboxParser) Continue(node ast.Node, reader text.Reader, pc parser.Context) parser.State { diff --git a/internal/router/basic-handler.go b/internal/router/basic-handler.go index a859d10..4a94a48 100644 --- a/internal/router/basic-handler.go +++ b/internal/router/basic-handler.go @@ -41,6 +41,12 @@ func (r *BasicHandler) Render(c *fiber.Ctx, supplements *Supplements, lang strin return fiber.StatusNoContent, nil } +func (r *BasicHandler) AddMeta(c *fiber.Ctx, supplements *Supplements, lang string, templateMap fiber.Map) (meta map[string]string, err error) { + return map[string]string{ + "robots": "noindex,nofollow", + }, nil +} + func (r *BasicHandler) RenderHeader(c *fiber.Ctx, supplements *Supplements, lang string, templateMap fiber.Map) (statusCode int, err error) { return fiber.StatusNoContent, nil } diff --git a/internal/router/handlers/lang-blog-title.go b/internal/router/handlers/lang-blog-title.go index 0f4f564..97de089 100644 --- a/internal/router/handlers/lang-blog-title.go +++ b/internal/router/handlers/lang-blog-title.go @@ -46,6 +46,20 @@ func (r *BlogPageHandler) ToValidateLang() router.LangSetting { return router.InPath } +func (r *BlogPageHandler) AddMeta(c *fiber.Ctx, supplements *router.Supplements, lang string, templateMap fiber.Map) (meta map[string]string, err error) { + metadata, _, err := supplements.B2Client.ReadFrontmatter(lang + "/" + c.Params("title") + ".md") + if err != nil { + return nil, fmt.Errorf("failed to read frontmatter of the desired blog post: %w", err) + } + + return map[string]string{ + "og:title": metadata.Title, + "og:description": fmt.Sprintf("%s [%s]", metadata.ShortDescription, metadata.ActionDate), + "og:image": fmt.Sprintf("https://f003.backblazeb2.com/file/sayana-photos/webp-320p/%s.webp", metadata.Thumbnail), + "twitter:card": "summary_large_image", + }, nil +} + func (r *BlogPageHandler) RenderBody(c *fiber.Ctx, supplements *router.Supplements, lang string, templateMap fiber.Map) (statusCode int, err error) { _, pathParts, _, err := router.GetPathFromReferer(c) if err != nil { diff --git a/internal/router/handlers/lang-map.go b/internal/router/handlers/lang-map.go index dbf1437..7df6104 100644 --- a/internal/router/handlers/lang-map.go +++ b/internal/router/handlers/lang-map.go @@ -3,6 +3,7 @@ package handlers import ( "fmt" "log/slog" + "slices" "strconv" "strings" @@ -41,6 +42,9 @@ func (r *MapHandler) ToValidateLang() router.LangSetting { func (r *MapHandler) Render(c *fiber.Ctx, supplements *router.Supplements, lang string, templateMap fiber.Map) (statusCode int, err error) { pages, err := supplements.B2Client.Scan(lang + "/") + slices.SortFunc(pages, func(a *b2.BlogPage, b *b2.BlogPage) int { + return a.Metadata.PublishedTime.Compare(b.Metadata.PublishedTime) + }) status := fiber.StatusOK if err != nil { slog.Error("received an error while scanning b2 pages", @@ -52,6 +56,7 @@ func (r *MapHandler) Render(c *fiber.Ctx, supplements *router.Supplements, lang } type MapMarker struct { + Index int `json:"Index"` Title string `json:"Title"` PageLink string `json:"PageLink"` Lat float64 `json:"Lat"` @@ -61,7 +66,7 @@ func (r *MapHandler) Render(c *fiber.Ctx, supplements *router.Supplements, lang } mapMarkers := make([]*MapMarker, 0, len(pages)) - for _, page := range pages { + for i, page := range pages { geolocationParts := strings.Split(page.Metadata.Geolocation, " ") if len(geolocationParts) < 2 { continue @@ -78,6 +83,7 @@ func (r *MapHandler) Render(c *fiber.Ctx, supplements *router.Supplements, lang } mapMarkers = append(mapMarkers, &MapMarker{ + Index: i, Title: page.Metadata.Title, PageLink: fmt.Sprintf("/%s/blog/%s", lang, page.FileName), Lat: x, diff --git a/internal/router/handlers/lang-user.go b/internal/router/handlers/lang-user.go index db566fe..c22bcac 100644 --- a/internal/router/handlers/lang-user.go +++ b/internal/router/handlers/lang-user.go @@ -37,6 +37,13 @@ func (r *UserHandler) ToValidateLang() router.LangSetting { return router.InPath } +func (r *UserHandler) AddMeta(c *fiber.Ctx, supplements *router.Supplements, lang string, templateMap fiber.Map) (meta map[string]string, err error) { + return map[string]string{ + "og:title": supplements.Localization[lang].BlogSearch.Header, + "og:description": supplements.Localization[lang].BlogSearch.Description, + }, nil +} + func (r *UserHandler) RenderBody(c *fiber.Ctx, supplements *router.Supplements, lang string, templateMap fiber.Map) (statusCode int, err error) { templateMap["Title"] = supplements.Localization[lang].UserProfile.Header diff --git a/internal/router/handlers/lang.go b/internal/router/handlers/lang.go index fc4deb6..74166ae 100644 --- a/internal/router/handlers/lang.go +++ b/internal/router/handlers/lang.go @@ -41,6 +41,14 @@ func (r *HomeHandler) ToValidateLang() router.LangSetting { return router.InPath } +func (r *HomeHandler) AddMeta(c *fiber.Ctx, supplements *router.Supplements, lang string, templateMap fiber.Map) (meta map[string]string, err error) { + return map[string]string{ + "og:title": supplements.Localization[lang].HomePage.Header, + "og:description": supplements.Localization[lang].HomePage.HomePageDescription, + "og:image": "https://f003.backblazeb2.com/file/sayana-static/home-page-gifs/" + fmt.Sprintf("otter-%d.gif", rand.Int()%3+1), + }, nil +} + func (r *HomeHandler) RenderBody(c *fiber.Ctx, supplements *router.Supplements, lang string, templateMap fiber.Map) (statusCode int, err error) { templateMap["Title"] = supplements.Localization[lang].HomePage.Header templateMap["FilledHeartCount"] = uint(40) diff --git a/internal/router/handlers/root.go b/internal/router/handlers/root.go index c8c4cd4..9f15782 100644 --- a/internal/router/handlers/root.go +++ b/internal/router/handlers/root.go @@ -35,6 +35,13 @@ func (r *RootHandler) CacheDuration() time.Duration { return 24 * time.Hour } +func (r *RootHandler) AddMeta(c *fiber.Ctx, supplements *router.Supplements, lang string, templateMap fiber.Map) (meta map[string]string, err error) { + return map[string]string{ + "og:title": "Saya Blog", + "og:description": "The blog of a 25 years old, travelling God knows where, proud to be not mainstream // Личный блог 25-летки, странствующего по ебеням, зато не мейнстрим", + }, nil +} + func (r *RootHandler) RenderBody(c *fiber.Ctx, supplements *router.Supplements, _ string, templateMap fiber.Map) (statusCode int, err error) { templateMap["Title"] = "Choose Your Language" templateMap["AvailableLanguages"] = supplements.AvailableLanguages diff --git a/internal/router/router.go b/internal/router/router.go index c0556f0..f28add2 100644 --- a/internal/router/router.go +++ b/internal/router/router.go @@ -60,6 +60,7 @@ type Route interface { ToValidateLang() LangSetting TemplatesToInject() []string Render(c *fiber.Ctx, supplements *Supplements, lang string, templateMap fiber.Map) (statusCode int, err error) + AddMeta(c *fiber.Ctx, supplements *Supplements, lang string, templateMap fiber.Map) (meta map[string]string, err error) RenderHeader(c *fiber.Ctx, supplements *Supplements, lang string, templateMap fiber.Map) (statusCode int, err error) RenderBody(c *fiber.Ctx, supplements *Supplements, lang string, templateMap fiber.Map) (statusCode int, err error) RenderFooter(c *fiber.Ctx, supplements *Supplements, lang string, templateMap fiber.Map) (statusCode int, err error) @@ -382,11 +383,18 @@ func (r *Router) generalPage(c *fiber.Ctx, route Route, lang string) error { return c.Status(fiber.StatusOK).Type("html").Send(val) } - content, err := r.supplements.TemplateManager.Render("general-page", fiber.Map{ + valueMap := fiber.Map{ "L": r.supplements.Localization[lang], "Lang": lang, "QueryString": queryString, - }) + } + + var err error + if valueMap["Meta"], err = route.AddMeta(c, r.supplements, lang, valueMap); err != nil { + slog.Warn("failed to receive meta", slog.String("path", path), slog.String("error", err.Error())) + } + + content, err := r.supplements.TemplateManager.Render("general-page", valueMap) if err != nil { slog.Warn("failed to generate div", slog.String("path", path), slog.String("error", err.Error())) return c.Status(fiber.ErrInternalServerError.Code).SendString("failed to generate div") diff --git a/internal/templatemanager/templatemanager.go b/internal/templatemanager/templatemanager.go index 75309e4..b23e2e8 100644 --- a/internal/templatemanager/templatemanager.go +++ b/internal/templatemanager/templatemanager.go @@ -32,6 +32,9 @@ var templateFuncMap = template.FuncMap{ return items }, "replace": strings.ReplaceAll, + "fdiv": func(a, b int) float64 { + return float64(a) / float64(b) + }, } func NewTemplateManager(templates ...TemplateManagerTemplates) (*TemplateManager, error) { diff --git a/locale/localization.en.yaml b/locale/localization.en.yaml index c7f2df8..e165866 100644 --- a/locale/localization.en.yaml +++ b/locale/localization.en.yaml @@ -1,6 +1,7 @@ TagsLabel: 'Tags:' BlogSearch: Header: 'Blog Search' + Description: "The Saya Blog posts' list" TagsHeader: 'Tags' OrderByHeader: 'Order by...' TitleOrdered: 'Title' @@ -9,6 +10,7 @@ BlogSearch: ChooseAllTags: 'Choose All' GlobalMap: Header: 'Global Map' + Description: "Global map with all the tags of places I've been to" HomePage: Header: 'Home Page' Contacts: 'Contacts' diff --git a/locale/localization.go b/locale/localization.go index c6467c4..a4f36f1 100644 --- a/locale/localization.go +++ b/locale/localization.go @@ -20,6 +20,7 @@ type LocaleConfig struct { type BlogSearchConfig struct { Header string `yaml:"Header" json:"Header"` + Description string `yaml:"Description" json:"Description"` TagsHeader string `yaml:"TagsHeader" json:"TagsHeader"` OrderByHeader string `yaml:"OrderByHeader" json:"OrderByHeader"` TitleOrdered string `yaml:"TitleOrdered" json:"TitleOrdered"` @@ -29,7 +30,8 @@ type BlogSearchConfig struct { } type GlobalMapConfig struct { - Header string `yaml:"Header" json:"Header"` + Header string `yaml:"Header" json:"Header"` + Description string `yaml:"Description" json:"Description"` } type HomePageConfig struct { diff --git a/locale/localization.ru.yaml b/locale/localization.ru.yaml index 5df82da..e65848a 100644 --- a/locale/localization.ru.yaml +++ b/locale/localization.ru.yaml @@ -1,6 +1,7 @@ TagsLabel: 'Тэги:' BlogSearch: Header: 'Поиск по блогу' + Description: 'Каталог записей Saya Blog' TagsHeader: 'Тэги' OrderByHeader: 'Упорядочить по...' TitleOrdered: 'названию' @@ -9,6 +10,7 @@ BlogSearch: ChooseAllTags: 'Выбрать все' GlobalMap: Header: 'Глобальная карта' + Description: 'Глобальная карта с метками мест, где я побывал' HomePage: Header: 'Домашняя страница' Contacts: 'Контакты' 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 { |