style: dark stealth theme with teal/burgundy pieces and cache-busting
Darken the DaisyUI theme and game board colors for a muted, low-chroma aesthetic. Pieces use dark teal vs burgundy for subtle contrast. Add MD5-based cache busting to the DaisyUI stylesheet link so CSS changes are picked up without a hard refresh.
This commit is contained in:
6
main.go
6
main.go
@@ -2,8 +2,10 @@ package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto/md5"
|
||||
"database/sql"
|
||||
_ "embed"
|
||||
"encoding/hex"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
@@ -32,11 +34,13 @@ var (
|
||||
var daisyUICSS []byte
|
||||
|
||||
func DaisyUIPlugin(v *via.V) {
|
||||
sum := md5.Sum(daisyUICSS)
|
||||
version := hex.EncodeToString(sum[:4])
|
||||
v.HTTPServeMux().HandleFunc("GET /_plugins/daisyui/style.css", func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "text/css")
|
||||
_, _ = w.Write(daisyUICSS)
|
||||
})
|
||||
v.AppendToHead(h.Link(h.Rel("stylesheet"), h.Href("/_plugins/daisyui/style.css")))
|
||||
v.AppendToHead(h.Link(h.Rel("stylesheet"), h.Href("/_plugins/daisyui/style.css?v="+version)))
|
||||
}
|
||||
|
||||
func port() string {
|
||||
|
||||
Reference in New Issue
Block a user