summaryrefslogtreecommitdiff
path: root/srv/src/cmd
diff options
context:
space:
mode:
authorBrian Picciano <mediocregopher@gmail.com>2022-05-17 13:52:18 -0600
committerBrian Picciano <mediocregopher@gmail.com>2022-05-17 13:52:18 -0600
commite742a2d6d5b75bce14a9be688c47c88807cfe94b (patch)
treea87e5e2fa64b88958d22a5ac58ca1b1c1cb85537 /srv/src/cmd
parent0fdece68c07836a566909d75a7f3836f229334b5 (diff)
Add BlogURL template function
Diffstat (limited to 'srv/src/cmd')
-rw-r--r--srv/src/cmd/mediocre-blog/main.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/srv/src/cmd/mediocre-blog/main.go b/srv/src/cmd/mediocre-blog/main.go
index 2660ea4..092c4da 100644
--- a/srv/src/cmd/mediocre-blog/main.go
+++ b/srv/src/cmd/mediocre-blog/main.go
@@ -53,6 +53,8 @@ func main() {
chatGlobalRoomMaxMsgs := cfg.Int("chat-global-room-max-messages", 1000, "Maximum number of messages the global chat room can retain")
chatUserIDCalcSecret := cfg.String("chat-user-id-calc-secret", "", "Secret to use when calculating user ids")
+ pathPrefix := cfg.String("path-prefix", "", "Prefix which is optionally applied to all URL paths rendered by the blog")
+
// initialization
err := cfg.Init(ctx)
@@ -70,6 +72,10 @@ func main() {
"chatGlobalRoomMaxMsgs", *chatGlobalRoomMaxMsgs,
)
+ if *pathPrefix != "" {
+ ctx = mctx.Annotate(ctx, "pathPrefix", *pathPrefix)
+ }
+
clock := clock.Realtime()
powStore := pow.NewMemoryStore(clock)
@@ -124,6 +130,7 @@ func main() {
apiParams.Logger = logger.WithNamespace("api")
apiParams.PowManager = powMgr
+ apiParams.PathPrefix = *pathPrefix
apiParams.PostStore = postStore
apiParams.PostAssetStore = postAssetStore
apiParams.MailingList = ml