Meta Description Bugfix #1
All checks were successful
release-tag / release-image (push) Successful in 2m9s
All checks were successful
release-tag / release-image (push) Successful in 2m9s
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user