Skip to content

refactor: extract hardcoded postguard.eu URL into SITE_URL constant#255

Merged
rubenhensen merged 1 commit into
mainfrom
refactor/site-url-constant
Jun 5, 2026
Merged

refactor: extract hardcoded postguard.eu URL into SITE_URL constant#255
rubenhensen merged 1 commit into
mainfrom
refactor/site-url-constant

Conversation

@dobby-coder

@dobby-coder dobby-coder Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Add a single shared SITE_URL to src/lib/env.ts and replace 24+ hardcoded 'https://postguard.eu' literals across 14 files. Uses the same runtimeConfig() pattern that BUSINESS_URL already follows.

Files touched

  • src/lib/env.ts — adds SITE_URL
  • src/lib/components/SEO.svelte, src/lib/authors.ts
  • src/routes/(marketing)/+page.svelte (6x JSON-LD), addons/+page.svelte (6x), about/+page.svelte (4x), privacy/+page.svelte (5x), blog/+page.svelte, blog/[slug]/+page.svelte, blog/rss.xml/+server.js
  • src/routes/(app)/fileshare/+page.svelte (2x), decrypt/+page.svelte (2x)
  • src/routes/sitemap.xml/+server.js, robots.txt/+server.js (the latter wasn't in the issue list but had the same literal)

Blog post content under src/content/blog/*.svx was intentionally left alone — those are written content, not code references.

Out of scope / behavior notes

  • Marketing pages are prerendered, so their JSON-LD blocks bake the fallback into static HTML at build time. A APP_CONFIG.SITE_URL runtime override only takes effect on non-prerendered (app) routes (/decrypt, /fileshare). The single-source goal (issue Refactor: extract hardcoded 'https://postguard.eu' into a shared SITE_URL constant #252's primary motivation) is still met: a future domain rename is one edit in env.ts plus a rebuild.
  • After the change, grep -rn \"'https://postguard.eu'\" src matches only the fallback in env.ts and the two blog post bodies.

Closes #252

Test plan

  • npm run check (svelte-check) — clean
  • npm run lint (prettier + eslint) — clean
  • npm run build — succeeds
  • Build output spot-checked: build/sitemap.xml, build/blog/rss.xml, build/robots.txt, build/index.html, build/about/index.html, build/privacy/index.html, build/addons/index.html all still contain https://postguard.eu in the expected places.

Replace 24+ literal 'https://postguard.eu' across 13 files with a single
SITE_URL exported from src/lib/env.ts, using the runtimeConfig mechanism
that BUSINESS_URL already follows so staging/dev can override without a
rebuild on non-prerendered routes.

Closes #252
@dobby-coder dobby-coder Bot requested a review from rubenhensen June 4, 2026 23:44
@rubenhensen rubenhensen merged commit b802e80 into main Jun 5, 2026
7 checks passed
rubenhensen pushed a commit to encryption4all/postguard-docs that referenced this pull request Jun 15, 2026
* docs: document pg-js 2.0 DecryptFileResult + onDownloadProgress + cause-preserving IdentityMismatchError

Sources:
- encryption4all/postguard-js#86 (DecryptFileResult shape change, onDownloadProgress)
- encryption4all/postguard-js#84 (IdentityMismatchError cause preservation)

* docs: clarify createEnvelope tier 2 vs tier 3 upload-failure semantics

Source: encryption4all/postguard-js#82 (re-throw on tier 3, console.warn on tier 2)

* docs: add Runtime config section for postguard-website APP_CONFIG keys

Sources:
- encryption4all/postguard-website#244 (STAGING)
- encryption4all/postguard-website#247 (GLITCHTIP_DSN)
- encryption4all/postguard-website#255 (SITE_URL)

* docs: surface private signing attributes on FriendlySender (from encryption4all/postguard-js#89)

* docs: document /download trust-confirmation gate (from encryption4all/postguard-website#258)

---------

Co-authored-by: dobby-yivi-agent[bot] <275734547+dobby-yivi-agent[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor: extract hardcoded 'https://postguard.eu' into a shared SITE_URL constant

1 participant