feat(web): set up templ layout with tailwindcss 4.3 and axios

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
This commit is contained in:
Sebastian UnterschützandClaude Opus 5.5 committed 2026-11-21 23:33:28 +01:00
1 parent 0af74267b9
commit 8ea459e5f1
10 files changed
+1702

No files matched your search

+29
View File
@@ -0,0 +1,29 @@
package web
import (
"embed"
"io/fs"
"net/http"
"github.com/a-h/templ"
"github.com/gin-gonic/gin"
)
//go:embed all:static
var static embed.FS
func Static() http.FileSystem {
sub, err := fs.Sub(static, "static")
if err != nil {
panic(err)
}
return http.FS(sub)
}
func Render(c *gin.Context, status int, comp templ.Component) {
c.Status(status)
c.Header("Content-Type", "text/html; charset=utf-8")
if err := comp.Render(c.Request.Context(), c.Writer); err != nil {
_ = c.Error(err)
}
}