diff options
| author | Gabriel A. Giovanini <mail@gabrielgio.me> | 2025-11-01 18:01:50 +0100 |
|---|---|---|
| committer | Gabriel A. Giovanini <mail@gabrielgio.me> | 2025-11-01 18:03:45 +0100 |
| commit | 49fc8733129028ff4a3537b9eb20f548f0e3e9e6 (patch) | |
| tree | 71b579b2914ce97b38d52c29795c3e3ba6518329 /pkg/handler/router.go | |
| parent | 5dd940eb52b40c78a2078ed0a02440e84bee0306 (diff) | |
| download | cerrado-49fc8733129028ff4a3537b9eb20f548f0e3e9e6.tar.gz cerrado-49fc8733129028ff4a3537b9eb20f548f0e3e9e6.tar.bz2 cerrado-49fc8733129028ff4a3537b9eb20f548f0e3e9e6.zip | |
feat: Add slug to css so we can cache it forever
Diffstat (limited to 'pkg/handler/router.go')
| -rw-r--r-- | pkg/handler/router.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pkg/handler/router.go b/pkg/handler/router.go index bc81350..cb5d6f5 100644 --- a/pkg/handler/router.go +++ b/pkg/handler/router.go @@ -1,6 +1,7 @@ package handler import ( + "fmt" "net/http" serverconfig "git.gabrielgio.me/cerrado/pkg/config" @@ -10,6 +11,7 @@ import ( "git.gabrielgio.me/cerrado/pkg/handler/git" "git.gabrielgio.me/cerrado/pkg/handler/static" "git.gabrielgio.me/cerrado/pkg/service" + "git.gabrielgio.me/cerrado/templates" ) // Mount handler gets the requires service and repository to build the handlers @@ -53,7 +55,7 @@ func MountHandler( } mux.HandleFunc("/static/{file}", staticHandler) - mux.HandleFunc("/static/theme", cssStaticHandler) + mux.HandleFunc(fmt.Sprintf("/static/theme%s.css", templates.Slug), cssStaticHandler) // add slug so css file can be cached forever. mux.HandleFunc("/{name}/about/{$}", gitHandler.About) mux.HandleFunc("/{name}", gitHandler.Multiplex) mux.HandleFunc("/{name}/{rest...}", gitHandler.Multiplex) |
