diff --git a/internal/httpapi/templates.go b/internal/httpapi/templates.go
index 8f3fbe8..39d1b53 100644
--- a/internal/httpapi/templates.go
+++ b/internal/httpapi/templates.go
@@ -42,6 +42,8 @@ func (s *Server) render(w http.ResponseWriter, name string, data map[string]any)
} else {
data["Title"] = strings.Title(base)
}
+ // Tell layout which content template to include
+ data["Content"] = base
w.Header().Set("Content-Type", "text/html; charset=utf-8")
- _ = tpl.ExecuteTemplate(w, name, data)
+ _ = tpl.ExecuteTemplate(w, "layout.tmpl", data)
}
diff --git a/internal/httpapi/templates/dashboard.tmpl b/internal/httpapi/templates/dashboard.tmpl
index a0fa421..b7f5111 100644
--- a/internal/httpapi/templates/dashboard.tmpl
+++ b/internal/httpapi/templates/dashboard.tmpl
@@ -1,4 +1,4 @@
-{{ define "content" }}
+{{ define "dashboard" }}
{{ end }}
-{{ template "layout.tmpl" . }}
+{{/* layout executes us via .Content */}}
diff --git a/internal/httpapi/templates/layout.tmpl b/internal/httpapi/templates/layout.tmpl
index d9a8b39..3bfc76e 100644
--- a/internal/httpapi/templates/layout.tmpl
+++ b/internal/httpapi/templates/layout.tmpl
@@ -19,7 +19,11 @@
- {{ block "content" . }}{{ end }}
+ {{ if eq .Content "dashboard" }}
+ {{ template "dashboard" . }}
+ {{ else if eq .Content "summarizer" }}
+ {{ template "summarizer" . }}
+ {{ end }}