tenseleyflow/shithub / c4e5c9c

Browse files

fix: helloData missing OG* fields surfaced by S09 _layout.html (home page 500)

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
c4e5c9c61892f58270235f068ee9fca4f8f9f355
Parents
1c8fbce
Tree
9277f01

1 changed file

StatusFile+-
M internal/web/handlers/hello.go 7 0
internal/web/handlers/hello.gomodified
@@ -23,6 +23,13 @@ type helloData struct {
23
 	Commit  string
23
 	Commit  string
24
 	BuiltAt string
24
 	BuiltAt string
25
 	LogoSVG template.HTML
25
 	LogoSVG template.HTML
26
+	// OG* are referenced by the shared _layout.html (S09). The fields
27
+	// must exist on every typed page-data struct that goes through the
28
+	// layout — html/template evaluates `{{ if .X }}` even on nil-checks
29
+	// and errors when X is missing.
30
+	OGTitle       string
31
+	OGDescription string
32
+	OGImage       string
26
 }
33
 }
27
 
34
 
28
 func (h helloHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
35
 func (h helloHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {