summaryrefslogtreecommitdiff
path: root/src/http/posts.go
diff options
context:
space:
mode:
authorBrian Picciano <mediocregopher@gmail.com>2024-05-18 18:29:19 +0200
committerBrian Picciano <mediocregopher@gmail.com>2024-05-18 18:29:19 +0200
commit0665d0c65974533fbd313f4e0b062b5103057aeb (patch)
tree5287795eed9767bd959a5139b77ef78b4024216d /src/http/posts.go
parentffa26298c95451639a6e01db6692d02d50b3d518 (diff)
Replace all URL rendering within templates by a URLConstructor
Diffstat (limited to 'src/http/posts.go')
-rw-r--r--src/http/posts.go6
1 files changed, 6 insertions, 0 deletions
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),