summaryrefslogtreecommitdiff
path: root/src/gmi
diff options
context:
space:
mode:
Diffstat (limited to 'src/gmi')
-rw-r--r--src/gmi/tpl.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gmi/tpl.go b/src/gmi/tpl.go
index e448afd..c648abd 100644
--- a/src/gmi/tpl.go
+++ b/src/gmi/tpl.go
@@ -37,6 +37,7 @@ type rendererGetPostSeriesNextPreviousRes struct {
type renderer struct {
url *url.URL
postStore post.Store
+ gmiPublicURL *url.URL
httpPublicURL *url.URL
}
@@ -92,7 +93,7 @@ func (r renderer) PostBody(p post.StoredPost) (string, error) {
preprocessFuncs := post.PreprocessFunctions{
BlogURL: func(path string) string {
- return filepath.Join("/", path)
+ return filepath.Join("/", r.gmiPublicURL.Path, path)
},
AssetURL: func(id string) string {
return filepath.Join("/assets", id)
@@ -220,6 +221,7 @@ func (a *api) tplHandler() (gemini.Handler, error) {
err := tpl.Execute(buf, renderer{
url: r.URL,
postStore: a.params.PostStore,
+ gmiPublicURL: a.params.PublicURL,
httpPublicURL: a.params.HTTPPublicURL,
})