Per-hostname data directory <hostname>/{content.kantadb, analytics.json, files} from CLI arg; drop learned site_url.
The first positional CLI argument (default localhost) names the site's public hostname and its data directory under the cwd, replacing the CWD-relative pagerite.* files. The public origin (https://<hostname>) is now authoritative configuration instead of a value learned from admin browsers: POST /_api/site-url, Data.site_url and the pagerite.js reporter are removed, and page rendering, sitemap, robots.txt and analytics own_origin all use SITE_URL consistently (localhost falls back to the request's base URL).
This commit is contained in:
@@ -152,6 +152,15 @@ function externalSlug(origin) {
|
||||
}
|
||||
}
|
||||
|
||||
/** Origin (scheme://host) of an external https URL, for favicon lookup. */
|
||||
function externalOrigin(url) {
|
||||
try {
|
||||
return new URL(url).origin
|
||||
} catch {
|
||||
return ''
|
||||
}
|
||||
}
|
||||
|
||||
/** Format one trail step: an internal page or an external https origin. */
|
||||
function stepOf(path, titles) {
|
||||
if (path?.startsWith('/')) {
|
||||
@@ -163,6 +172,7 @@ function stepOf(path, titles) {
|
||||
slug: externalSlug(path),
|
||||
title: 'External site',
|
||||
external: true,
|
||||
origin: externalOrigin(path),
|
||||
}
|
||||
}
|
||||
return null
|
||||
|
||||
Reference in New Issue
Block a user