Skip to content

Commit 4fa6218

Browse files
committed
another dirty trick
1 parent 8ebd51b commit 4fa6218

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

.github/workflows/nextjs.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,13 @@ jobs:
7474

7575
# Deployment job
7676
deploy:
77-
# environment:
78-
# name: github-pages
79-
# url: ${{ steps.deployment.outputs.page_url }}
77+
environment:
78+
name: github-pages
79+
url: ${{ steps.deployment.outputs.page_url }}
8080
runs-on: ubuntu-latest
8181
needs: build
8282
steps:
83+
- run: echo "$BASE_PATH this is the base path"
8384
- name: Deploy to GitHub Pages
8485
id: deployment
8586
uses: actions/deploy-pages@v4

next.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @type {import('next').NextConfig} */
22
const nextConfig = {
33
output: "export",
4-
// basePath: process.env.BASE_PATH,
4+
basePath: process.env.BASE_PATH,
55
};
66
module.exports = nextConfig;

src/components/image.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const Image: React.FC<Props> = ({
3232

3333
return (
3434
<img
35-
src={`${process.env.BASE_PATH}${src}`}
35+
src={`${process.env.BASE_PATH ? process.env.BASE_PATH : ""}${src}`}
3636
alt={alt}
3737
sx={{ width: finalWidth, height: finalHeight, objectFit }}
3838
className={className}

0 commit comments

Comments
 (0)