Big refactor
This commit is contained in:
@@ -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"),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user