refactor: make templates take a more specific struct
1 file changed, 6 insertions(+), 9 deletions(-)
changed files
M templates/list.templ → templates/list.templ
@@ -1,12 +1,9 @@ package templates -import ( - "go.alanpearce.eu/homestead/internal/config" - "go.alanpearce.eu/homestead/internal/content" -) +import "go.alanpearce.eu/homestead/internal/content" -templ TagPage(config *config.Config, tag string, posts []*content.Post, path string) { - @Layout(config, PageSettings{ +templ TagPage(site SiteSettings, tag string, posts []*content.Post, path string) { + @Layout(site, PageSettings{ Title: tag, Path: path, TitleAttrs: templ.Attributes{@@ -24,9 +21,9 @@ @list(posts) } } -templ ListPage(config *config.Config, posts []*content.Post, path string) { - @Layout(config, PageSettings{ - Title: config.Title, +templ ListPage(site SiteSettings, posts []*content.Post, path string) { + @Layout(site, PageSettings{ + Title: site.Title, TitleAttrs: templ.Attributes{ "class": "p-author h-card", "rel": "author",