Big refactor

This commit is contained in:
2022-08-18 17:08:05 +02:00
parent 0520e7641f
commit 92cee16cc8
56 changed files with 475 additions and 293 deletions
+3 -3
View File
@@ -91,16 +91,16 @@ func (r *TemplateRenderer) Load(name string) *CachedTemplate {
}
// Render the template, also injects "Page" and "Config" values in the template
func (r *TemplateRenderer) Render(w io.Writer, name string, data util.H) error {
func (r *TemplateRenderer) Render(w io.Writer, name string, data util.Map) error {
cachedTemplate := r.Load(name)
if config.Mode == "development" {
cachedTemplate.Reload()
}
newData := util.H{}
newData := util.Map{}
newData.Apply(data)
newData["Page"] = util.H{
newData["Page"] = util.Map{
// Used to inject a page specific class on <body>
"Name": strings.TrimSuffix(path.Base(name), ".html"),
}