From 0665d0c65974533fbd313f4e0b062b5103057aeb Mon Sep 17 00:00:00 2001 From: Brian Picciano Date: Sat, 18 May 2024 18:29:19 +0200 Subject: Replace all URL rendering within templates by a URLConstructor --- src/http/posts.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/http/posts.go') diff --git a/src/http/posts.go b/src/http/posts.go index 14224f2..42e5b4a 100644 --- a/src/http/posts.go +++ b/src/http/posts.go @@ -40,10 +40,16 @@ func (a *api) postPreprocessFuncImage(args ...string) (string, error) { tpl = txttpl.Must(tpl.Parse(mustReadTplFile("image.html"))) tplPayload := struct { + RootURL render.URLBuilder ID string Descr string Resizable bool }{ + RootURL: render.NewURLBuilder( + a.params.PublicURL, + a.params.PublicURL, // httpURL + a.params.GeminiPublicURL, + ), ID: id, Descr: descr, Resizable: asset.IsImageResizable(id), -- cgit v1.2.3