mirror of
https://github.com/TecharoHQ/anubis.git
synced 2026-04-19 22:56:39 +00:00
1562f88c35
* chore(xess): remove unused xess templates Signed-off-by: Jason Cameron <git@jasoncameron.dev> * chore(checker): remove unused staticHashChecker implementation Signed-off-by: Jason Cameron <git@jasoncameron.dev> * feat: add pinact and deadcode to go tools (pinact is used for the gha pinning) Signed-off-by: Jason Cameron <git@jasoncameron.dev> * chore: update Docker and kubectl actions to latest versions Signed-off-by: Jason Cameron <git@jasoncameron.dev> * chore: update Homebrew action from master to main in workflow files See https://github.com/Homebrew/actions/commit/df537ec97fb77a615dc06a860b3d5b6d9c256cdb Signed-off-by: Jason Cameron <git@jasoncameron.dev> * chore: remove unused go-colorable and tools dependencies from go.sum Signed-off-by: Jason Cameron <git@jasoncameron.dev> * chore: update postcss-import and other dependencies to latest versions Signed-off-by: Jason Cameron <git@jasoncameron.dev> * chore: update Docusaurus dependencies to version 3.8.1 Signed-off-by: Jason Cameron <git@jasoncameron.dev> * chore: downgrade playwright and playwright-core to version 1.52.0 Signed-off-by: Jason Cameron <git@jasoncameron.dev> --------- Signed-off-by: Jason Cameron <git@jasoncameron.dev>
39 lines
872 B
Go
39 lines
872 B
Go
// 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"
|
|
"path/filepath"
|
|
|
|
"github.com/TecharoHQ/anubis"
|
|
"github.com/TecharoHQ/anubis/internal"
|
|
)
|
|
|
|
var (
|
|
//go:embed *.css static
|
|
Static embed.FS
|
|
|
|
URL = "/.within.website/x/xess/xess.css"
|
|
)
|
|
|
|
func init() {
|
|
Mount(http.DefaultServeMux)
|
|
|
|
//goland:noinspection GoBoolExpressions
|
|
if anubis.Version != "devel" {
|
|
URL = filepath.Join(filepath.Dir(URL), "xess.min.css")
|
|
}
|
|
|
|
URL = URL + "?cachebuster=" + anubis.Version
|
|
}
|
|
|
|
// Mount registers the xess static file handlers on the given mux
|
|
func Mount(mux *http.ServeMux) {
|
|
prefix := anubis.BasePrefix + "/.within.website/x/xess/"
|
|
|
|
mux.Handle(prefix, internal.UnchangingCache(http.StripPrefix(prefix, http.FileServerFS(Static))))
|
|
}
|