🐛 Fixed Site Params parsing

This commit is contained in:
Maxim Lebedev 2023-11-09 05:05:53 +06:00
parent c7158f47dd
commit e74c0a0b66
Signed by: toby3d
GPG Key ID: 1F14E25B7C119FC5
1 changed files with 7 additions and 1 deletions

View File

@ -56,7 +56,7 @@ func (repo *fileSystemSiteRepository) Get(ctx context.Context, lang language.Tag
}
defer f.Close()
data := new(Site)
data := NewSite()
if data.Content, err = frontmatter.Parse(f, data, FrontMatterFormats...); err != nil {
return nil, fmt.Errorf("cannot parse site content as FrontMatter: %w", err)
}
@ -93,3 +93,9 @@ func (tz TimeZone) MarshalYAML() (any, error) {
return tz.Location.String(), nil
}
func NewSite() *Site {
return &Site{
Params: make(map[string]any),
}
}