summaryrefslogtreecommitdiff
path: root/src/render/methods.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/render/methods.go')
-rw-r--r--src/render/methods.go14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/render/methods.go b/src/render/methods.go
index 9b5a41e..ee22dfd 100644
--- a/src/render/methods.go
+++ b/src/render/methods.go
@@ -56,6 +56,8 @@ type Methods struct {
ctx context.Context
url *url.URL
publicURL *url.URL
+ httpURL *url.URL
+ geminiURL *url.URL
geminiGatewayURL *url.URL
postStore post.Store
postAssetStore asset.Store
@@ -71,6 +73,8 @@ func NewMethods(
ctx context.Context,
url *url.URL,
publicURL *url.URL,
+ httpURL *url.URL,
+ geminiURL *url.URL,
geminiGatewayURL *url.URL,
postStore post.Store,
postAssetStore asset.Store,
@@ -81,6 +85,8 @@ func NewMethods(
ctx,
url,
publicURL,
+ httpURL,
+ geminiURL,
geminiGatewayURL,
postStore,
postAssetStore,
@@ -91,6 +97,10 @@ func NewMethods(
}
}
+func (m *Methods) RootURL() URLBuilder {
+ return NewURLBuilder(m.publicURL, m.httpURL, m.geminiURL)
+}
+
func (m *Methods) GetTags() ([]string, error) {
return m.postStore.GetTags()
}
@@ -263,7 +273,3 @@ func (m *Methods) GetPath() (string, error) {
}
func (m *Methods) Add(a, b int) int { return a + b }
-
-func (m *Methods) URLIsSafe(s string) template.URL {
- return template.URL(s)
-}