Commit 687b404

bryfry <bryon@fryer.io>
2025-07-22 10:50:11
Fix template execution: use ExecuteTemplate with base template name
- Change from ts.Execute() to ts.ExecuteTemplate(w, "base", data) - This properly executes the named "base" template with inheritance - Fixes empty page issue where templates weren't rendering See: docs/todo/task_1.8.md
1 parent 3b2c2a8
Changed files (2)
cmd/web/handlers.go
@@ -36,8 +36,8 @@ func home(w http.ResponseWriter, r *http.Request) {
 		Content:     nil,
 	}
 
-	// Execute template
-	err = ts.Execute(w, data)
+	// Execute template - specify the base template name
+	err = ts.ExecuteTemplate(w, "base", data)
 	if err != nil {
 		log.Println(err.Error())
 		http.Error(w, "Internal Server Error", 500)
@@ -66,8 +66,8 @@ func submitForm(w http.ResponseWriter, r *http.Request) {
 		Content:     nil,
 	}
 
-	// Execute template
-	err = ts.Execute(w, data)
+	// Execute template - specify the base template name
+	err = ts.ExecuteTemplate(w, "base", data)
 	if err != nil {
 		log.Println(err.Error())
 		http.Error(w, "Internal Server Error", 500)
CLAUDE.md