aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXe Iaso <me@xeiaso.net>2025-01-24 20:01:26 -0500
committerXe Iaso <me@xeiaso.net>2025-01-24 20:01:26 -0500
commit9dfd542f84d63a997bb7b2ac4e8ef8eb81200205 (patch)
tree674393c94e8f64699037ef87e2590c7ed57cece8
parent2eae2a4cf5ed2507f6525e2f3c2e055935eeda0e (diff)
downloadx-9dfd542f84d63a997bb7b2ac4e8ef8eb81200205.tar.xz
x-9dfd542f84d63a997bb7b2ac4e8ef8eb81200205.zip
xess: give minified version in prod, but not in development
Signed-off-by: Xe Iaso <me@xeiaso.net>
-rw-r--r--xess/xess.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/xess/xess.go b/xess/xess.go
index d405871..dfdcc7c 100644
--- a/xess/xess.go
+++ b/xess/xess.go
@@ -6,6 +6,7 @@ package xess
import (
"embed"
"net/http"
+ "path/filepath"
"within.website/x"
"within.website/x/internal"
@@ -16,14 +17,19 @@ import (
//go:generate npm run build
var (
- //go:embed xess.min.css static
+ //go:embed xess.min.css xess.css static
Static embed.FS
- URL = "/.within.website/x/xess/xess.min.css"
+ URL = "/.within.website/x/xess/xess.css"
)
func init() {
Mount(http.DefaultServeMux)
+
+ if x.Version != "devel" {
+ URL = filepath.Join(filepath.Dir(URL), "xess.min.css")
+ }
+
URL = URL + "?cachebuster=" + x.Version
}