Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ jobs:
run: npm run build:website
env:
SEARCH_URL: ${{ secrets.SEARCH_URL }}
BASE_HREF: /moaw/
- name: Setup GitHub Pages
uses: actions/configure-pages@v4
- name: Upload artifact
Expand Down
4 changes: 0 additions & 4 deletions packages/website/scripts/update-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,8 @@ fi
dist_folder="dist/website"
version="sha.$(git rev-parse --short HEAD)"
ai_search_url="${AI_SEARCH_URL:-}"
base_href="${BASE_HREF:-/}"

perl -i -pe "s/__VERSION__/$version/g" $dist_folder/main.*.js
perl -i -pe "s/__AI_SEARCH_URL__/$ai_search_url/g" $dist_folder/main.*.js
perl -i -pe "s|__BASE_HREF__|$base_href|g" $dist_folder/404.html
perl -i -pe "s|<base href=\"/\">|<base href=\"$base_href\">|g" $dist_folder/index.html

echo Version: $version
echo Base href: $base_href
2 changes: 1 addition & 1 deletion packages/website/src/public/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<!-- Workaround for GitHub Pages not supporting SPA routing -->
<script>
sessionStorage.redirect = location.href;
const url = window.location.hostname.includes('.github.io') ? '__BASE_HREF__' : '/';
const url = window.location.hostname.includes('.github.io') ? '/moaw/' : '/';
window.location.replace(url);
</script>
</head>
Expand Down
5 changes: 5 additions & 0 deletions packages/website/src/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
<title>MOAW</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script>
if (window.location.hostname.includes('.github.io')) {
window.document.head.getElementsByTagName('base')[0].href = '/moaw/';
}
</script>
<link rel="icon" type="image/png" href="favicon.png">
<script type="text/javascript">
(function(c,l,a,r,i,t,y){
Expand Down