From 5dd940eb52b40c78a2078ed0a02440e84bee0306 Mon Sep 17 00:00:00 2001 From: "Gabriel A. Giovanini" Date: Sat, 1 Nov 2025 17:49:20 +0100 Subject: feat: Write css dark/light theme on standalone url This will allow tho write both themes into the same css file. Also mend with the css generate by chroma so it can be nested. --- pkg/handler/router.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'pkg/handler/router.go') diff --git a/pkg/handler/router.go b/pkg/handler/router.go index fea8827..bc81350 100644 --- a/pkg/handler/router.go +++ b/pkg/handler/router.go @@ -31,6 +31,14 @@ func MountHandler( return nil, err } + cssStaticHandler, err := static.ServeStaticCSSHandler( + configRepo.GetSyntaxHighlight(), + configRepo.GetSyntaxHighlightDark(), + ) + if err != nil { + return nil, err + } + mux := ext.NewRouter() mux.AddMiddleware(ext.Compress) mux.AddMiddleware(ext.Log) @@ -45,6 +53,7 @@ func MountHandler( } mux.HandleFunc("/static/{file}", staticHandler) + mux.HandleFunc("/static/theme", cssStaticHandler) mux.HandleFunc("/{name}/about/{$}", gitHandler.About) mux.HandleFunc("/{name}", gitHandler.Multiplex) mux.HandleFunc("/{name}/{rest...}", gitHandler.Multiplex) -- cgit v1.2.3