This repository was archived by the owner on Mar 24, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Fix GitHub Pages deployment for React SPA routing and CNAME configuration #5
Merged
aabs
merged 4 commits into
master
from
copilot/fix-a46ebfeb-485c-4197-8993-c0b2d48542fe
Aug 27, 2025
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| <!DOCTYPE html> | ||
| <html> | ||
| <head> | ||
| <meta charset="utf-8"> | ||
| <title>Fifth Programming Language</title> | ||
| <script type="text/javascript"> | ||
| // Single Page Apps for GitHub Pages | ||
| // MIT License | ||
| // https://github.com/rafgraph/spa-github-pages | ||
| // This script takes the current url and converts the path and query | ||
| // string into just a query string, and then redirects the browser | ||
| // to the new url with only a query string and hash fragment, | ||
| // e.g. https://fifthlang.github.io/l/foo/bar?a=b&c=d#qwe, becomes | ||
| // https://fifthlang.github.io/?/foo/bar&a=b~and~c=d#qwe | ||
| // Note: this 404.html file must be at least 512 bytes for it to work | ||
| // with Internet Explorer (it is currently > 512 bytes) | ||
|
|
||
| // If you're creating a Project Pages site and NOT using a custom domain, | ||
| // then set pathSegmentsToKeep to 1 (enterprise users may need to set it to > 1). | ||
| // This way the code will only replace the route part and not the real directory. | ||
| // For example, if your repo is at https://username.github.io/repo-name, | ||
| // then set pathSegmentsToKeep to 1 so that routes like /repo-name/about will | ||
| // become /repo-name/?/about, and not /?/repo-name/about. | ||
|
|
||
| var pathSegmentsToKeep = 0; | ||
|
|
||
| var l = window.location; | ||
| l.replace( | ||
| l.protocol + '//' + l.hostname + (l.port ? ':' + l.port : '') + | ||
| l.pathname.split('/').slice(0, 1 + pathSegmentsToKeep).join('/') + '/?/' + | ||
| l.pathname.slice(1).split('/').slice(pathSegmentsToKeep).join('/').replace(/&/g, '~and~') + | ||
| (l.search ? '&' + l.search.slice(1).replace(/&/g, '~and~') : '') + | ||
| l.hash | ||
| ); | ||
|
|
||
| </script> | ||
| </head> | ||
| <body> | ||
| </body> | ||
| </html> | ||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pathSegmentsToKeep value should be 1 for GitHub Project Pages sites. Since this appears to be hosted at 'aabs.github.io/fifthlang.github.io', setting it to 0 will cause incorrect URL rewriting that strips the repository name from the path.