diff options
Diffstat (limited to 'templates/page.templ')
-rw-r--r-- | templates/page.templ | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/templates/page.templ b/templates/page.templ index 7a43485..39dd263 100644 --- a/templates/page.templ +++ b/templates/page.templ @@ -3,7 +3,8 @@ package templates import ( "io/fs" - "website/internal/config" + "go.alanpearce.eu/website/internal/config" + "net/url" ) var ( @@ -86,8 +87,12 @@ templ Page(site *config.Config, page PageSettings) { </html> } -func mkURL(u config.URL, path string, title string) string { - q := u.Query() +func mkURL(original config.URL, path string, title string) string { + ou := *original.URL + u := config.URL{ + URL: &ou, + } + q := url.Values{} q.Add("p", path) q.Add("t", title) u.RawQuery = q.Encode() @@ -96,7 +101,7 @@ func mkURL(u config.URL, path string, title string) string { } templ counter(config *config.Config, path string, title string) { - <script data-goatcounter={ config.GoatCounter.String() } async src="https://gc.zgo.at/count.v4.js" crossorigin="anonymous" integrity="sha384-nRw6qfbWyJha9LhsOtSb2YJDyZdKvvCFh0fJYlkquSFjUxp9FVNugbfy8q1jdxI+"></script> + <script data-goatcounter={ config.GoatCounter.String() } async src="https://stats.alanpearce.eu/count.v4.js" crossorigin="anonymous" integrity="sha384-nRw6qfbWyJha9LhsOtSb2YJDyZdKvvCFh0fJYlkquSFjUxp9FVNugbfy8q1jdxI+"></script> <noscript> <img src={ string(templ.URL(mkURL(config.GoatCounter, path, title))) }/> </noscript> |