aboutsummaryrefslogtreecommitdiffstats
path: root/internal/config/config.go
diff options
context:
space:
mode:
authorgrm <grm@eyesin.space>2026-09-12 11:43:14 +0300
committergrm <grm@eyesin.space>2026-09-12 11:43:14 +0300
commitf0eaf46755e04b806e2df07a2fabd4060a72d54c (patch)
treef6d8f9fda0bb6e2fa7ae6304d4ad0c12217f3233 /internal/config/config.go
parent3eb04b1a2bdf9e53231fe862cfd76327371a9741 (diff)
downloadblogspace-f0eaf46755e04b806e2df07a2fabd4060a72d54c.tar.gz
blogspace-f0eaf46755e04b806e2df07a2fabd4060a72d54c.tar.bz2
blogspace-f0eaf46755e04b806e2df07a2fabd4060a72d54c.zip
Serve the superadmin's blog on the root domain
The base domain (and www.) now serves a regular blog owned by the first superadmin, created automatically on startup, alongside the management routes. Literal management paths take precedence over the blog's page wildcards, and the slugs they would shadow are reserved. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Sd8UPWrvyYCLj97JexNw3A
Diffstat (limited to 'internal/config/config.go')
-rw-r--r--internal/config/config.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/internal/config/config.go b/internal/config/config.go
index 4972178..7a3a79c 100644
--- a/internal/config/config.go
+++ b/internal/config/config.go
@@ -53,8 +53,15 @@ func Load() (*Config, error) {
return c, nil
}
+// RootSubdomain is the pseudo-subdomain of the blog served on the base domain
+// itself (and on www.). It is owned by the superadmin.
+const RootSubdomain = "www"
+
// BlogURL returns the public URL for a blog subdomain.
func (c *Config) BlogURL(sub string) string {
+ if sub == RootSubdomain {
+ return c.RootURL()
+ }
return "http://" + sub + "." + c.HostWithPort()
}