feat: deploy to GitHub Pages with adapter-static#5
Open
raduab wants to merge 9 commits intojhwheeler:mainfrom
Open
feat: deploy to GitHub Pages with adapter-static#5raduab wants to merge 9 commits intojhwheeler:mainfrom
raduab wants to merge 9 commits intojhwheeler:mainfrom
Conversation
✅ Deploy Preview for fluidlanguage ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Author
|
I hadn't realized the site already had a live deployment flow through Netlify! If you're happy with Netlify, feel free to close this PR. If you'd like to simplify things by using GitHub for both the repo and the live deployment, this PR sets that up. Enjoy! |
All internal hrefs now use SvelteKit's `base` from `$app/paths` so they resolve correctly when the site is served under /fluid_language/. Also guards `$page.url.searchParams` on the homepage with a `browser` check so it doesn't break during prerendering.
- Initialize mounted = !browser to avoid content disappearing between SSR and onMount during hydration - Extract dev detection to named const, include 'preview' mode so npm run preview works at root without base path
- Replace inner <main> with <div> in post page to avoid duplicate
landmarks that confuse screen readers
- Simplify {#if mounted || !browser} to {#if mounted} since mounted
is initialized to !browser, making the disjunction redundant
231c0e3 to
92565d3
Compare
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.
Hey Jackson! I find your writing genuinely interesting and thought-provoking, and I think it deserves a wider audience than a GitHub repo. I'd love to help bring it more to life by getting the site deployed and accessible online.
Summary
adapter-autotoadapter-staticwith full prerendering for GitHub Pages deploymentmainbasepath for/fluid_language/subpath routingTest plan
Notes on URL structure
The site deploys to
https://jhwheeler.github.io/fluid_language/(subpath) because GitHub Pages serves non-<username>.github.iorepos under/<repo-name>/. This requires thepaths.baseconfig insvelte.config.jsand{base}prefixes on all internal links.To move to root domain (
jhwheeler.github.io)jhwheeler.github.iosvelte.config.js, remove thepaths.baseconfig (or set it to'')baseimports in components will resolve to empty string, so links work unchangedTo use a custom domain (e.g.,
fluidlanguage.com)jhwheeler.github.io)svelte.config.js, remove thepaths.baseconfig (custom domains serve from root)static/CNAMEfile containing your domain name