Skip to content

deploy: serve at sunaemon.dev/math/ as a project page; drop the unused --base-path feature - #3

Merged
sunaemon merged 2 commits into
mainfrom
fix-deploy-path
Jun 28, 2026
Merged

sunaemon merged 2 commits into
mainfrom
fix-deploy-path

Conversation

@sunaemon

@sunaemon sunaemon commented Jun 28, 2026

Copy link
Copy Markdown
Owner

Problem

The viewer was published at https://sunaemon.dev/math/math/polish-space-ch1//math/ doubled.

sunaemon.dev is the custom domain of the user site (sunaemon.github.io), so this repo is served as a project page at sunaemon.dev/math/ automatically (prefix = repo name). The deploy also passed --base-path math and wrote CNAME=sunaemon.dev, which doubled the prefix and re-claimed a domain the user site owns.

Fix

Two commits:

  1. deploy — build the dist with no base path and no CNAME (make dist BOOKLINK_PROJECT=polish-space-ch1; removed the Set custom domain step). The viewer derives the /math/ prefix from the URL at runtime (util.ts mountPrefix), so it lands at https://sunaemon.dev/math/polish-space-ch1/.
  2. viewer — remove the now-unused --base-path / --legacy-redirect dist feature (and its path-prefix validation) from static-dist.ts, restoring the host-root dist layout. The pre-move sunaemon.dev/polish-space-ch1/ URL is handled by a redirect in the user-site repo, so no --legacy-redirect is needed.

Verified: make lint-actionlint + make lint-tsc pass; a default-mode dist build serves index.htmlpolish-space-ch1/ with the mount at polish-space-ch1/.

After merge

  • Settings → Pages on this repo: custom domain should be empty (it inherits the user site's apex). The workflow no longer re-asserts one.
  • math-private still has the old workflow + the static-dist.ts feature; it needs the same change so a future make publish export doesn't reintroduce the doubling/feature.

🤖 Generated with Claude Code

…e /math/)

sunaemon.dev is the custom domain of the user site (sunaemon.github.io), so
this repo is served as a project page at sunaemon.dev/math/ automatically —
the /math/ prefix comes from the repo name. The deploy was also passing
--base-path math and writing CNAME=sunaemon.dev, which (a) added a second
/math/ segment, publishing the viewer at sunaemon.dev/math/math/polish-space-ch1/,
and (b) re-claimed a domain the user site owns.

Drop both: build the dist with no base path and no CNAME. The viewer derives
the /math/ prefix from the URL at runtime (util.ts mountPrefix), so it lands
at sunaemon.dev/math/polish-space-ch1/. The pre-move sunaemon.dev/polish-space-ch1/
URL is now handled by a redirect in the user-site repo, so the build needs no
--legacy-redirect either.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 28, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The GitHub Pages workflow removes BOOKLINK_DIST_FLAGS (which set --base-path math and --legacy-redirect) from the ch1 viewer build step, and drops the subsequent step that wrote sunaemon.dev into dist/CNAME. Comments added inline explain the rationale.

Changes

Pages Deploy Workflow

Layer / File(s) Summary
Drop static base-path flags and CNAME artifact step
.github/workflows/deploy-pages.yml
make dist for the ch1 viewer no longer sets BOOKLINK_DIST_FLAGS; the step that wrote sunaemon.dev to dist/CNAME is removed; inline comments added explaining runtime URL derivation and domain conflict avoidance.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • sunaemon/math#2: Modifies the same deploy-pages.yml workflow's make dist arguments and CNAME handling for the ch1 viewer build.

Poem

🐇 No more CNAME, no hardcoded path,
The URL speaks for itself — do the math!
The base-path flags have hopped away,
Runtime derivation saves the day.
A cleaner workflow, hip-hop-hooray! 🌿

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main deployment change to serve the site at /math/ and remove the unused base-path setting.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-deploy-path

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

With the viewer served as a project page at sunaemon.dev/math/ (the /math/
prefix coming from the repo name, detected at runtime by util.ts mountPrefix),
the static-dist --base-path/--legacy-redirect flags and their path-prefix
validation are dead code. Restore static-dist.ts to building the dist at the
host root: <dist>/index.html redirects to <mount>/, the mount tree sits at
<dist>/<mount>/. Deletes parseArgs/normalizePrefix handling for both flags.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sunaemon sunaemon changed the title deploy: serve at sunaemon.dev/math/ as a project page (drop the double /math/) deploy: serve at sunaemon.dev/math/ as a project page; drop the unused --base-path feature Jun 28, 2026
@sunaemon
sunaemon merged commit 2fcfb04 into main Jun 28, 2026
2 checks passed
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.

1 participant