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