Files
podstalk/handler/template.go
T
jbrechtel 9c24b30262
Build and Deploy / build-and-deploy (push) Successful in 1m3s
Fix blank page: URL types and inline style issues in templates
- Use template.URL for all URLs passed to templates (RSSURL, ImageURL)
- Pre-compute episode image URLs in handler as safe types
- Remove all inline style attributes, use CSS classes instead
- Add template error logging to catch silent failures
- HTML/template rejects raw strings in URL and CSS+URL contexts
2026-07-08 12:24:38 -04:00

21 lines
391 B
Go

package handler
import (
"html/template"
"io"
"log"
)
type Templates struct {
tmpl *template.Template
}
func NewTemplates(tmpl *template.Template) *Templates {
return &Templates{tmpl: tmpl}
}
func (t *Templates) Render(w io.Writer, name string, data any) {
if err := t.tmpl.ExecuteTemplate(w, name+".html", data); err != nil {
log.Printf("template error: %s: %v", name, err)
}
}