feat(pages): serve landing site at custom-domain root with clean URLs#407
Merged
Conversation
Migrate the landing site from the GitHub Pages subpath /open-code-review/ to the root of the open-codereview.ai custom domain and drop the /#/ from URLs: - webpack publicPath -> '/' so assets load at the domain root - switch HashRouter -> BrowserRouter for clean paths (e.g. /docs) - fix HeroSection '#/docs' anchor to a router Link - add public/CNAME (open-codereview.ai) for the GitHub Pages custom domain - emit 404.html (copy of index.html) as SPA deep-link fallback
Contributor
|
✅ OpenCodeReview: No comments generated. Looks good to me. |
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
Prepares the landing site (
pages/) to be served at the root of theopen-codereview.aicustom domain and drops the/#/from URLs.webpack.config.js:publicPath→/so assets load at the domain root (previously hard-coded to the/open-code-review/GitHub Pages subpath). Adds a secondHtmlWebpackPluginthat emits404.html(a copy ofindex.html) as an SPA deep-link fallback.src/index.tsx:HashRouter→BrowserRouterfor clean paths (e.g./docsinstead of/#/docs).src/components/HeroSection.tsx: replace the hard-codedhref="#/docs"anchor with a router<Link to="/docs">(the in-page#quickstartanchor is intentionally kept).public/CNAME: addopen-codereview.aiso GitHub Pages serves the site at the custom-domain root.Why
The site is moving from
alibaba.github.io/open-code-review/to the short custom domainopen-codereview.ai. Serving at a subpath forces the ugly/open-code-review/asset prefix and theHashRouter/#/URLs. This change makes the build target the domain root and produces clean, shareable URLs.Release note⚠️
Merging this to
maintriggers the Pages deploy, which activates theCNAMEand makes GitHub Pages claimopen-codereview.ai(and redirect the old subpath). This must be merged in coordination with the DNS cutover — if DNS is not yet pointing the domain at GitHub Pages, the site will be unreachable until it is.Client-side routing (
BrowserRouter) relies on the404.htmlfallback on plain GitHub Pages; once the site moves behind a CDN, the fallback should be handled by the CDN (404 →index.html, HTTP 200).Verification
npm run buildsucceeds;dist/index.htmlreferences assets at root (/bundle.js),dist/404.htmlmatchesindex.html, anddist/CNAMEcontainsopen-codereview.ai.ocr reviewon the diff: 0 comments.