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. --- templates/base.qtpl | 2 ++ templates/base.qtpl.go | 53 +++++++++++++++++++++++++------------------------- 2 files changed, 28 insertions(+), 27 deletions(-) (limited to 'templates') diff --git a/templates/base.qtpl b/templates/base.qtpl index b3df94a..e43fb67 100644 --- a/templates/base.qtpl +++ b/templates/base.qtpl @@ -60,6 +60,8 @@ Page prints a page implementing Page interface. {%= p.Title(ctx) %} + + diff --git a/templates/base.qtpl.go b/templates/base.qtpl.go index dce4cbc..783de2c 100644 --- a/templates/base.qtpl.go +++ b/templates/base.qtpl.go @@ -8,16 +8,14 @@ package templates //line templates/base.qtpl:3 -import "context" - -//line templates/base.qtpl:4 -import "strconv" +import ( + "context" + "strconv" + "time" //line templates/base.qtpl:4 -//line templates/base.qtpl:5 -import "time" + //line templates/base.qtpl:5 + //line templates/base.qtpl:7 -//line templates/base.qtpl:7 -import ( qtio422016 "io" qt422016 "github.com/valyala/quicktemplate" @@ -112,59 +110,60 @@ func StreamPageTemplate(qw422016 *qt422016.Writer, p Page, ctx context.Context) qw422016.E().S(Slug) //line templates/base.qtpl:62 qw422016.N().S(`.css"> + `) -//line templates/base.qtpl:68 +//line templates/base.qtpl:70 p.StreamNavbar(qw422016, ctx) -//line templates/base.qtpl:68 +//line templates/base.qtpl:70 qw422016.N().S(`
`) -//line templates/base.qtpl:70 +//line templates/base.qtpl:72 p.StreamContent(qw422016, ctx) -//line templates/base.qtpl:70 +//line templates/base.qtpl:72 qw422016.N().S(`
`) -//line templates/base.qtpl:73 +//line templates/base.qtpl:75 p.StreamScript(qw422016, ctx) -//line templates/base.qtpl:73 +//line templates/base.qtpl:75 qw422016.N().S(` `) -//line templates/base.qtpl:78 +//line templates/base.qtpl:80 } -//line templates/base.qtpl:78 +//line templates/base.qtpl:80 func WritePageTemplate(qq422016 qtio422016.Writer, p Page, ctx context.Context) { -//line templates/base.qtpl:78 +//line templates/base.qtpl:80 qw422016 := qt422016.AcquireWriter(qq422016) -//line templates/base.qtpl:78 +//line templates/base.qtpl:80 StreamPageTemplate(qw422016, p, ctx) -//line templates/base.qtpl:78 +//line templates/base.qtpl:80 qt422016.ReleaseWriter(qw422016) -//line templates/base.qtpl:78 +//line templates/base.qtpl:80 } -//line templates/base.qtpl:78 +//line templates/base.qtpl:80 func PageTemplate(p Page, ctx context.Context) string { -//line templates/base.qtpl:78 +//line templates/base.qtpl:80 qb422016 := qt422016.AcquireByteBuffer() -//line templates/base.qtpl:78 +//line templates/base.qtpl:80 WritePageTemplate(qb422016, p, ctx) -//line templates/base.qtpl:78 +//line templates/base.qtpl:80 qs422016 := string(qb422016.B) -//line templates/base.qtpl:78 +//line templates/base.qtpl:80 qt422016.ReleaseByteBuffer(qb422016) -//line templates/base.qtpl:78 +//line templates/base.qtpl:80 return qs422016 -//line templates/base.qtpl:78 +//line templates/base.qtpl:80 } -- cgit v1.2.3