From 2d446a1375d2e8bd28942254b656f76e76e3978e Mon Sep 17 00:00:00 2001 From: svemagie <869694+svemagie@users.noreply.github.com> Date: Tue, 28 Apr 2026 16:24:32 +0200 Subject: [PATCH] =?UTF-8?q?fix(site):=20normalize=20SITE=5FURL=20to=20svem?= =?UTF-8?q?agie.net=20=E2=80=94=20migration=20domain=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Gitea secret SITE_URL is stuck at blog.giersig.eu (API update returns 204 but value doesn't change). Normalize the old domain at read time so all discovery links, canonical URL, and fediverse:creator use svemagie.net. Co-Authored-By: Claude Sonnet 4.6 --- _data/site.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/_data/site.js b/_data/site.js index a52b165..3a0442f 100644 --- a/_data/site.js +++ b/_data/site.js @@ -5,6 +5,10 @@ * All values have sensible defaults for initial deployment. */ +// Normalize site URL — replaces old domain after migration (secret may not be updated yet) +const SITE_URL = (process.env.SITE_URL || "https://svemagie.net") + .replace("blog.giersig.eu", "svemagie.net"); + // Parse social links from env (format: "name|url|icon,name|url|icon") function parseSocialLinks(envVar) { if (!envVar) return []; @@ -22,7 +26,7 @@ function getFediverseCreator() { // Primary: site's own ActivityPub actor (canonical fediverse identity) const apHandle = process.env.ACTIVITYPUB_HANDLE; if (apHandle) { - const domain = (process.env.SITE_URL || "https://example.com").replace(/^https?:\/\//, ""); + const domain = SITE_URL.replace(/^https?:\/\//, ""); return `@${apHandle}@${domain}`; } // Fallback: external Mastodon account (syndication target) @@ -56,15 +60,14 @@ function buildSocialFromFeeds() { } const apHandle = process.env.ACTIVITYPUB_HANDLE; if (apHandle) { - const siteUrl = process.env.SITE_URL || "https://example.com"; - links.push({ name: "ActivityPub", url: `${siteUrl}/activitypub/users/${apHandle}`, rel: "me", icon: "activitypub" }); + links.push({ name: "ActivityPub", url: `${SITE_URL}/activitypub/users/${apHandle}`, rel: "me", icon: "activitypub" }); } return links; } // site.url: no trailing slash — used as URL base for path concatenation ({{ site.url }}/path) // site.me / site.author.url: trailing slash — Mastodon rel="me" requires exact match -const siteUrlBase = (process.env.SITE_URL || "https://example.com").replace(/\/$/, ""); +const siteUrlBase = SITE_URL.replace(/\/$/, ""); const siteUrlWithSlash = siteUrlBase + "/"; export default { @@ -121,7 +124,7 @@ export default { // Webmentions configuration webmentions: { - domain: process.env.SITE_URL?.replace("https://", "").replace("http://", "") || "example.com", + domain: SITE_URL.replace("https://", "").replace("http://", ""), }, // Fediverse creator for meta tag (e.g., @rick@rmendes.net)