From a46309ac64261814d931f538fad373ea8a4f0e95 Mon Sep 17 00:00:00 2001 From: ivar Date: Fri, 3 Apr 2026 14:46:05 +0200 Subject: feat: embed admin templates into binary with //go:embed Move admin templates from templates/admin/*.html to internal/admin/templates/*.html and embed them using //go:embed directive. This removes the runtime dependency on having template files on disk, allowing the templates to be compiled into the binary. Changes: - Add embed import and //go:embed directive for templates - Change ParseGlob() to ParseFS() to load from embedded filesystem - Copy templates to internal/admin/templates/ for embedding Co-Authored-By: Claude Haiku 4.5 --- internal/admin/templates/list.html | 40 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 internal/admin/templates/list.html (limited to 'internal/admin/templates/list.html') diff --git a/internal/admin/templates/list.html b/internal/admin/templates/list.html new file mode 100644 index 0000000..561e317 --- /dev/null +++ b/internal/admin/templates/list.html @@ -0,0 +1,40 @@ +{{define "list-content"}} +

Posts

+ {{if .Posts}} + + + + + + + + + + + {{range .Posts}} + + + + + + + {{end}} + +
TitleDateTags
{{.Title}}{{.Date}} + {{if .Tags}} +
+ {{range (splitTags .Tags)}}{{.}}{{end}} +
+ {{end}} +
+
+ Edit +
+ +
+
+
+ {{else}} +
No posts yet. Create one.
+ {{end}} +{{end}} -- cgit v1.3