Meta Description Bugfix #1
All checks were successful
release-tag / release-image (push) Successful in 2m9s

This commit is contained in:
2025-05-05 21:08:06 +02:00
parent 38fa612a18
commit b1536ad724

View File

@@ -107,9 +107,10 @@ func LoadDir(root string) ([]Article, error) {
// ---------- NEU ----------
type StaticPage struct {
Title string
Slug string
Body template.HTML
Title string
Slug string
Description string
Body template.HTML
}
// helper.go einmal zentral verwenden
@@ -166,8 +167,9 @@ func LoadStatic(dir string) (map[string]StaticPage, error) {
}
var meta struct {
Title string `json:"title"`
Slug string `json:"slug"`
Title string `json:"title"`
Slug string `json:"slug"`
Description string `json:"description"`
}
if err := json.Unmarshal(headerJSON, &meta); err != nil {
return nil, fmt.Errorf("%s: %w", path, err)
@@ -187,9 +189,10 @@ func LoadStatic(dir string) (map[string]StaticPage, error) {
}
pages[meta.Slug] = StaticPage{
Title: meta.Title,
Slug: meta.Slug,
Body: template.HTML(body),
Title: meta.Title,
Slug: meta.Slug,
Description: meta.Description,
Body: template.HTML(body),
}
}
return pages, nil