// Package xess vendors a copy of Xess and makes it available at /.xess/xess.css // // This is intended to be used as a vendored package in other projects. package xess import ( "embed" "net/http" "github.com/a-h/templ" "within.website/x" "within.website/x/internal" ) //go:generate go tool templ generate var ( //go:embed xess.css static Static embed.FS URL = "/.within.website/x/xess/xess.css" ) func init() { Mount(http.DefaultServeMux) URL = URL + "?cachebuster=" + x.Version } func Mount(mux *http.ServeMux) { mux.Handle("/.within.website/x/xess/", internal.UnchangingCache(http.StripPrefix("/.within.website/x/xess/", http.FileServerFS(Static)))) } func NotFound(w http.ResponseWriter, r *http.Request) { templ.Handler( Simple("Not found: "+r.URL.Path, fourohfour(r.URL.Path)), templ.WithStatus(http.StatusNotFound), ) }