From f86a9a9d25f0b1c9b8c35dedd2e8056b34b3865d Mon Sep 17 00:00:00 2001 From: jeremiah-carlson Date: Sat, 9 Sep 2023 21:45:13 -0400 Subject: [PATCH] Bugfix: Hash Routing --- .github/workflows/deploy-gh-pages.yaml | 4 +--- www/.env.github | 1 + www/src/index.jsx | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) create mode 100644 www/.env.github diff --git a/.github/workflows/deploy-gh-pages.yaml b/.github/workflows/deploy-gh-pages.yaml index 3e69bdf..a8c8327 100644 --- a/.github/workflows/deploy-gh-pages.yaml +++ b/.github/workflows/deploy-gh-pages.yaml @@ -1,9 +1,6 @@ name: Deploy GitHub Pages on: workflow_dispatch -env: - HASH_ROUTING: true - jobs: # Build job build: @@ -16,6 +13,7 @@ jobs: - uses: actions/setup-node@v3 with: node-version: '18' + - run: mv .env.github .env - run: npm install . - run: npm run build - uses: actions/upload-pages-artifact@v2 diff --git a/www/.env.github b/www/.env.github new file mode 100644 index 0000000..9fd942c --- /dev/null +++ b/www/.env.github @@ -0,0 +1 @@ +VITE_ROUTING=hash \ No newline at end of file diff --git a/www/src/index.jsx b/www/src/index.jsx index f83159c..76c015b 100644 --- a/www/src/index.jsx +++ b/www/src/index.jsx @@ -13,7 +13,7 @@ if (import.meta.env.DEV && !(root instanceof HTMLElement)) { ); } -const routerSrc = (import.meta.env['HASH_ROUTING'] == true)? hashIntegration() : null; +const routerSrc = (["hash", "HASH"].includes(import.meta.env.VITE_ROUTING))? hashIntegration() : null; render(() => (