feat: serve the site under the /smg base path - #25
Merged
Conversation
Set kit.paths.base to /smg so the site can be mounted at lightseek.org/smg behind an edge proxy while staying fully functional on its *.pages.dev origin. Internal URLs are made base-aware at their sources of truth: nav config data, the markdown link and asset rewriters, and the handful of hardcoded hrefs in components. Favicons and logo assets go through $app/paths so SvelteKit's relative asset resolution keeps working from any mount point. A root _redirects rule sends the bare origin host to /smg so old links do not 404. Verified against the production build under wrangler pages dev: root redirect, base-prefixed nav and markdown links, D1-backed hero content, and static/markdown image resolution. Signed-off-by: Simo Lin <25425177+slin1237@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Phase 2 of the domain plan: mount the docs at https://lightseek.org/smg (the URL the existing
smg.lightseek.orgvanity redirect already points to). An edge proxy on thelightseek.orgzone forwards/smg*to this Pages project path-preserving, so the app itself must live under/smg.kit.paths.base = '/smg'links.ts) prefixes rewritten doc links,lightseek.org/smg/...links, and image paths with the baseSiteHeader/SiteFooter/HomeHero/HomeChoosePathand favicon/logo asset paths now go through$app/paths_redirects(/ → /smg 302) so the baresmg-anw.pages.devhost doesn't 404Verification
Production build under
wrangler pages dev:/→ 302 →/smg;/smg→ 308 →/smg/(SvelteKit canonicalization) → 200/smg/getting-started|concepts|reference|contributing/smg/concepts/architecture/overview→ 200; markdown-embedded images resolve (relative and rewritten paths)pnpm build/pnpm lint/pnpm checkall cleanRollout
Merging deploys this to
smg-anw.pages.dev/smg. After that, the zone-side snippet onlightseek.org(/smg*→ proxy to the Pages host) goes live andhttps://lightseek.org/smgserves the docs;smg.lightseek.orgstarts resolving via its existing 301.🤖 Generated with Claude Code