all repos — homestead @ e4e8173ab6124daa84ef012e73c111f111d4a8cf

Code for my website

refactor: make templates take a more specific struct

Alan Pearce
commit

e4e8173ab6124daa84ef012e73c111f111d4a8cf

parent

a9f47f4e4ed3223e86dc1d5c3edd005b8d9ce589

1 file changed, 6 insertions(+), 9 deletions(-)

changed files
M templates/list.templtemplates/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",