pckage htmxgo provides utilities for serving htmx library.
Look https://htmx.org/ for more information about htmx.
It can be imported as a library into golang project and hooked up to any HTTP router or server. It supports compression and caches compressed content in memory, but lazily and doesn't waste memory on unused encodings.
All functions are safe for concurrent use.
Currently supported encodings are:
- plain text
- deflate
- gzip
- brotli
- Module: BSD 3-Clause License
- HTMX lib: BSD 2-Clause License
import "github.com/ninedraft/htmx-go"
go get -v github.com/ninedraft/htmx-go@latest
// your router setup
mux.Get("/assets/htmx.min.js", htmxgo.ServeHTTP)
Release versions are the same as htmx versions. API can and will be broken.
Updating htmx version:
wget 'https://unpkg.com/[email protected]/dist/htmx.min.js' -O htmx.min.js
For pet experiments. I don't want to import htmx via unpkg nor do I want to setup tooling for frontend stuff. Don't use in production, it will backfire, I swear to you. It's mostly a meme module.