summaryrefslogtreecommitdiff
path: root/internal/router/handlers/root.go
diff options
from:
to:
context:
space:
mode:
authorGravatar SayaAndy <saya.andy@posteo.com> 2026-03-31 00:06:46 +0700
committerGravatar SayaAndy <saya.andy@posteo.com> 2026-03-31 00:06:46 +0700
commita0ace41ad3b0f4661e98d8fa8ef254369cc80d1e (patch)
treeb5b5c58d42918bab94fd3a6980268ef55dc71f40 /internal/router/handlers/root.go
parentbe906e1cc4ec3e92bcb14ee08256b53f3a4b44e2 (diff)
downloadweb-a0ace41ad3b0f4661e98d8fa8ef254369cc80d1e.tar.gz
web-a0ace41ad3b0f4661e98d8fa8ef254369cc80d1e.zip
feat: specify canonical hrefs for each page
feat: specify more meta properties for search engines fix: correct user and catalogue meta format: specify og property names in property field feat: user profile description
Diffstat (limited to 'internal/router/handlers/root.go')
-rw-r--r--internal/router/handlers/root.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/internal/router/handlers/root.go b/internal/router/handlers/root.go
index 89b9c63..f188a61 100644
--- a/internal/router/handlers/root.go
+++ b/internal/router/handlers/root.go
@@ -1,6 +1,7 @@
package handlers
import (
+ "fmt"
"time"
"github.com/SayaAndy/saya-today-web/internal/router"
@@ -39,10 +40,12 @@ func (r *RootHandler) SitemapInfo(_ *router.Supplements) []router.SitemapInfo {
return []router.SitemapInfo{{Loc: "", Priority: 0.7}}
}
-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-летки, странствующего по ебеням, зато не мейнстрим",
+func (r *RootHandler) AddMeta(c *fiber.Ctx, supplements *router.Supplements, lang string, templateMap fiber.Map) (meta []router.MetaField, err error) {
+ return []router.MetaField{
+ {Property: "og:title", Content: "Saya Blog"},
+ {Property: "og:description", Content: "The blog of a 25 years old, travelling God knows where, proud to be not mainstream // Личный блог 25-летки, странствующего по ебеням, зато не мейнстрим"},
+ {Property: "og:url", Content: fmt.Sprint(templateMap["CanonicalEndpoint"])},
+ {Property: "og:type", Content: "website"},
}, nil
}