Skip to content

Commit

Permalink
try to fix base path issue for static export 2
Browse files Browse the repository at this point in the history
  • Loading branch information
ct-chu authored Apr 18, 2024
1 parent 27833bc commit a3f387d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/nextjs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ jobs:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
env:
NEXT_PUBLIC_BASE_PATH: /planisphere
needs: build
steps:
- name: Deploy to GitHub Pages
Expand Down
3 changes: 2 additions & 1 deletion next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/** @type {import('next').NextConfig} */
const isProd = process.env.NODE_ENV === 'production'

const nextConfig = {
output: 'export',
basePath: process.env.NEXT_PUBLIC_BASE_PATH,
assetPrefix: process.env.NEXT_PUBLIC_BASE_PATH,
};

export default nextConfig;
4 changes: 3 additions & 1 deletion src/app/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import React, { useState, useEffect } from 'react';
import { TransformWrapper, TransformComponent, useControls } from "react-zoom-pan-pinch";
import { useOrientation } from "react-use";

import { prefix } from './prefix.js';

const yellowStarchart = `${prefix}/STARMAPv2022_yellow_3600x.png`
const orangeStarchart = `${prefix}/STARMAPv2022_orange_3600x.png`
const redStarchart = `${prefix}/STARMAPv2022_red_3600x.png`
Expand All @@ -35,7 +37,7 @@ const darkTheme = createTheme({
},
typography: {
fontFamily: [
"NotoSansTC",
"Noto Sans TC",
'sans-serif',
].join(','),
},
Expand Down

0 comments on commit a3f387d

Please sign in to comment.