Added a configurable site origin to the ConfigReader+Properties extension in the Website library target.

This commit is contained in:
2026-08-25 16:24:03 +02:00
parent 5b2da4eb16
commit 988090a511
4 changed files with 27 additions and 7 deletions
@@ -240,6 +240,17 @@ package extension ConfigReader {
)
}
/// The public origin the site is served at (scheme and host, no trailing slash), read from the `site.origin` key.
///
/// The redirects and any absolute links derive from it, so a staging deployment can point it at itself or leave it unset without the
/// production origin leaking into its markup.
var siteOrigin: String {
string(
forKey: .Site.origin,
default: .Site.origin
)
}
/// The directory the static files are served from, read from the `path.staticFiles` key.
var staticFilesPath: String {
string(