Skip to content

Pre-render with vite-ssg and deploy to GitHub Pages - #3

Closed
mathhulk wants to merge 2 commits into
claude/vibrant-faraday-ux7zgr-optimizefrom
claude/vibrant-faraday-ux7zgr-pages
Closed

mathhulk wants to merge 2 commits into
claude/vibrant-faraday-ux7zgr-optimizefrom
claude/vibrant-faraday-ux7zgr-pages

Conversation

@mathhulk

Copy link
Copy Markdown
Collaborator

3 of 3 (stacked on the optimizations PR, so this diff shows only the SSG and deploy changes). Retarget to develop once the earlier PRs merge.

SSG

bun run build now runs vite-ssg, which pre-renders /, /campus and /club to static HTML and then hydrates them into the same SPA.

  • Output is flat (club.html, campus.html), so GitHub Pages serves /club directly without a redirect to /club/.
  • The catch-all route is also rendered as 404.html, which Pages serves for unknown URLs with a real 404 status.
  • Critical CSS is inlined per page (beasties).
  • Each page gets its own <title> via @unhead/vue, driven by route meta.
  • To keep hydration clean, the Club credits are shuffled after mount, and Campus shows "Checking mc.blockeley.com" until the first status response, so "offline" is no longer baked into the static HTML.

Deploy workflow (.github/workflows/deploy.yml)

  • Pull requests: bun install --frozen-lockfile, lint and build. No deploy.
  • Pushes to develop, or manual runs: the same steps, then upload dist/ and deploy it with actions/deploy-pages@v5.
  • Adds public/CNAME with blockeley.com.

Repo settings needed before the first deploy

  1. Settings → Pages → Source: "GitHub Actions". The pages branch currently has a CNAME for blockeley.mathhulk.com.
  2. Settings → Environments → github-pages: allow develop to deploy. By default only the default branch, master, can deploy there.
  3. DNS: blockeley.com is currently served from another host behind Cloudflare. Point it at GitHub Pages (apex A/AAAA records to GitHub's Pages IPs), then set the custom domain in the Pages settings and enable HTTPS.

Verification

  • Ran the build behind a static server that mimics Pages: /, /club and /campus return 200, and unknown paths return 404 with the Page Not Found page.
  • Screenshots are identical to the previous PR's SPA build (except the randomly shuffled credits).
  • Built with __VUE_PROD_HYDRATION_MISMATCH_DETAILS__ on: no hydration warnings and no console errors.
  • The interaction checks (mobile menu, edition toggle, full screen, credits hover) still pass.
  • The workflow itself can't run until it's on GitHub; this PR's own pull_request run will be its first test.

Generated by Claude Code

- Build with vite-ssg: /, /campus and /club are rendered to static HTML
  at build time (flat club.html/campus.html so Pages serves them without
  a redirect) and hydrate into the same SPA; the catch-all route is also
  rendered as 404.html, which Pages serves with a 404 status
- Critical CSS is inlined per page with beasties
- Per-page <title> via @unhead/vue, driven by route meta
- Club: shuffle the builder credits after mount so the pre-rendered
  HTML hydrates without a mismatch
- Campus: show "Checking mc.blockeley.com" until the first status
  response, instead of baking "offline" into the static HTML
- public/CNAME for blockeley.com
- .github/workflows/deploy.yml: lint + build every pull request; on
  push to develop (or manual dispatch) upload dist/ and deploy it with
  actions/deploy-pages

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DxVDmLPux3Tx7RV1v4yznD
@mathhulk mathhulk closed this Nov 22, 2026
@mathhulk
mathhulk deleted the claude/vibrant-faraday-ux7zgr-pages branch November 23, 2026 00:05
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.

2 participants