refactor: use go:embed for templates

Templates are now embedded using //go:embed and parsed once at startup
with template.Must(template.ParseFS(...)). This avoids re-parsing
template files from disk on every request and removes the dependency
on template files being present at runtime.

closes #7
This commit is contained in:
clawbot
2026-03-01 15:47:22 -08:00
committed by user
parent 7bbe47b943
commit d4eef6bd6a
6 changed files with 56 additions and 36 deletions

View File

@@ -54,6 +54,6 @@ func (h *Handlers) HandleProfile() http.HandlerFunc {
}
// Render the profile page
h.renderTemplate(w, r, []string{"templates/base.html", "templates/profile.html"}, data)
h.renderTemplate(w, r, "profile.html", data)
}
}