Fix blank page: URL types and inline style issues in templates
Build and Deploy / build-and-deploy (push) Successful in 1m3s

- 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
This commit is contained in:
2026-07-08 12:24:38 -04:00
parent cc62eea701
commit 9c24b30262
5 changed files with 66 additions and 30 deletions
+4 -2
View File
@@ -3,6 +3,7 @@ package handler
import (
"html/template"
"io"
"log"
)
type Templates struct {
@@ -12,7 +13,8 @@ type Templates struct {
func NewTemplates(tmpl *template.Template) *Templates {
return &Templates{tmpl: tmpl}
}
func (t *Templates) Render(w io.Writer, name string, data any) {
_ = t.tmpl.ExecuteTemplate(w, name+".html", data)
if err := t.tmpl.ExecuteTemplate(w, name+".html", data); err != nil {
log.Printf("template error: %s: %v", name, err)
}
}