summaryrefslogtreecommitdiffci
path: root/internal/router
diff refs
from: back
to: back
| flip
diff options
context:
space:
mode:
Diffstat (limited to 'internal/router')
-rw-r--r--internal/router/handlers/api-v1-like-get.go2
-rw-r--r--internal/router/handlers/lang-blog-title.go6
-rw-r--r--internal/router/handlers/root.go7
-rw-r--r--internal/router/router.go2
4 files changed, 10 insertions, 7 deletions
diff --git a/internal/router/handlers/api-v1-like-get.go b/internal/router/handlers/api-v1-like-get.go
index 0eaf5f6..9e2c856 100644
--- a/internal/router/handlers/api-v1-like-get.go
+++ b/internal/router/handlers/api-v1-like-get.go
@@ -42,7 +42,7 @@ func (r *GetLikeHandler) Render(c *fiber.Ctx, supplements *router.Supplements, l
return fiber.StatusBadRequest, fmt.Errorf("error getting path from referer: %w", err)
}
- if len(pathParts) != 3 && pathParts[1] != "blog" {
+ if len(pathParts) != 3 || pathParts[1] != "blog" {
return fiber.StatusBadRequest, fmt.Errorf("invalid path format: expected '/:lang/blog/:page', got '%s'", path)
}
diff --git a/internal/router/handlers/lang-blog-title.go b/internal/router/handlers/lang-blog-title.go
index 5a1155d..76dc335 100644
--- a/internal/router/handlers/lang-blog-title.go
+++ b/internal/router/handlers/lang-blog-title.go
@@ -156,7 +156,13 @@ func (r *BlogPageHandler) RenderHeader(c *fiber.Ctx, supplements *router.Supplem
return fiber.StatusNotFound, fmt.Errorf("could not read '%s' for metadata: %w", path, err)
}
+ pageTitle := metadata.Title
+ if metadata.Medley != "" {
+ pageTitle += " // " + l10n.T.GetPath(lang, "Medleys", metadata.Medley).(string)
+ }
+
templateMap["Title"] = metadata.Title
+ templateMap["PageTitle"] = pageTitle
return fiber.StatusOK, nil
}
diff --git a/internal/router/handlers/root.go b/internal/router/handlers/root.go
index 6a011e4..4fc4e31 100644
--- a/internal/router/handlers/root.go
+++ b/internal/router/handlers/root.go
@@ -47,11 +47,8 @@ func (r *RootHandler) AddMeta(c *fiber.Ctx, supplements *router.Supplements, lan
{Property: "og:url", Content: fmt.Sprint(templateMap["CanonicalEndpoint"]) + "/"},
{Property: "og:type", Content: "website"},
}
- if supplements.Meta.GoogleSiteVerification != "" {
- meta = append(meta, router.MetaField{Name: "google-site-verification", Content: supplements.Meta.GoogleSiteVerification})
- }
- if supplements.Meta.YandexVerification != "" {
- meta = append(meta, router.MetaField{Name: "yandex-verification", Content: supplements.Meta.YandexVerification})
+ for _, field := range supplements.Meta {
+ meta = append(meta, router.MetaField{Name: field.Name, Content: field.Value})
}
return meta, nil
}
diff --git a/internal/router/router.go b/internal/router/router.go
index c8b5686..a11a934 100644
--- a/internal/router/router.go
+++ b/internal/router/router.go
@@ -102,7 +102,7 @@ type Supplements struct {
BlogTrigger *blogtrigger.BlogTriggerScheduler
TemplateManager *templatemanager.TemplateManager
MarkdownRenderer goldmark.Markdown
- Meta config.MetaConfig
+ Meta []config.MetaConfig
PhotoStorage config.PhotoStorageConfig
StaticStorage config.StaticStorageConfig
}