Vendor htmx 2.0.4

This commit is contained in:
Tim Van Baak 2025-01-27 20:34:07 -08:00
parent af77322755
commit 76449d814f
5 changed files with 12 additions and 0 deletions

View File

@ -26,6 +26,9 @@ var funcs = template.FuncMap{
//go:embed intake.css
var Stylesheet []byte
//go:embed htmx.org@2.0.4.js
var Htmx []byte
//go:embed *.html
var templates embed.FS

File diff suppressed because one or more lines are too long

View File

@ -5,6 +5,7 @@
<title>{{ block "title" . }}Intake{{ end }}</title>
<link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAOwgAADsIBFShKgAAAABh0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMS41ZEdYUgAAAGFJREFUOE+lkFEKwDAIxXrzXXB3ckMm9EnAV/YRCxFCcUXEL3Jc77NDjpDA/VGL3RFWYEICfeGC8oQc9IPuCAnQDcoRVmBCAn3hgvKEHPSD7ggJ0A3KEVZgQgJ94YLSJ9YDUzNGDXGZ/JEAAAAASUVORK5CYII=">
<link rel="stylesheet" href="/style.css">
<script src="/htmx.org@2.0.4.js"></script>
</head>
<body>
<main>

View File

@ -29,6 +29,7 @@ func RunServer(db *core.DB, addr string, port string) {
handleFunc("GET /", env.getRoot)
handleFunc("GET /style.css", env.getStyle)
handleFunc("GET /htmx.org@2.0.4.js", env.getScript)
handleFunc("GET /source/{source}", env.getSource)
handleFunc("GET /item/{source}/{id}", env.getItem)

View File

@ -33,3 +33,9 @@ func (env *Env) getStyle(writer http.ResponseWriter, req *http.Request) {
writer.Header()["Content-Type"] = []string{"text/css; charset=utf-8"}
writer.Write(html.Stylesheet)
}
func (env *Env) getScript(writer http.ResponseWriter, req *http.Request) {
writer.Header()["Cache-Control"] = []string{"public, max-age=86400"}
writer.Header()["Content-Type"] = []string{"application/javascript; charset=utf-8"}
writer.Write(html.Htmx)
}