summaryrefslogtreecommitdiff
path: root/src/post/preprocess.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/post/preprocess.go')
-rw-r--r--src/post/preprocess.go17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/post/preprocess.go b/src/post/preprocess.go
index 424c7b8..3ec54ca 100644
--- a/src/post/preprocess.go
+++ b/src/post/preprocess.go
@@ -17,6 +17,12 @@ type PreprocessFunctions struct {
// The given path should not have a leading slash.
BlogURL func(path string) string
+ // BlogURL returns the given string, rooted to the base URL of the blog's
+ // HTTP server (which may or may not include path components itself).
+ //
+ // The given path should not have a leading slash.
+ BlogHTTPURL func(path string) string
+
// AssetURL returns the URL of the asset with the given ID.
AssetURL func(id string) string
@@ -39,11 +45,12 @@ type PreprocessFunctions struct {
func (funcs PreprocessFunctions) ToFuncsMap() template.FuncMap {
return template.FuncMap{
- "BlogURL": funcs.BlogURL,
- "AssetURL": funcs.AssetURL,
- "PostURL": funcs.PostURL,
- "StaticURL": funcs.StaticURL,
- "Image": funcs.Image,
+ "BlogURL": funcs.BlogURL,
+ "BlogHTTPURL": funcs.BlogHTTPURL,
+ "AssetURL": funcs.AssetURL,
+ "PostURL": funcs.PostURL,
+ "StaticURL": funcs.StaticURL,
+ "Image": funcs.Image,
}
}