Skip to content

Commit 841c3d7

Browse files
committed
Add env variables
1 parent bb2d0ff commit 841c3d7

File tree

4 files changed

+15
-10
lines changed

4 files changed

+15
-10
lines changed

.github/workflows/deploy-node.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ jobs:
2727
cache: 'npm'
2828
- run: npm ci
2929
- run: npm run build
30+
env:
31+
NEXT_PUBLIC_BASE_PATH: /WebXDAO.github.io
3032
- run: npm run export
33+
env:
34+
NEXT_PUBLIC_BASE_PATH: /WebXDAO.github.io
3135
- run: touch ./out/.nojekyll
3236

3337
- name: Deploy 🚀

components/Global/Navbar.jsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { AiOutlineClose } from 'react-icons/ai'
44
import Link from 'next/link'
55
import { useRouter } from 'next/router'
66
import {prefix} from '../../constants'
7+
78
const NavBarItem = ({ item, pathname, classprops }) => (
89
<a href={item.url}>
910
<li
@@ -20,13 +21,13 @@ const Navbar = () => {
2021
const router = useRouter()
2122
const [toggleMenu, setToggleMenu] = useState(false)
2223
const navItems = [
23-
{ title: 'HOME', url: '/' },
24-
{ title: 'LEARN', url: '#' },
25-
{ title: 'BLOG', url: '/blog' },
26-
{ title: 'ABOUT', url: '#' },
27-
{ title: 'PROJECTS', url: '/projects' },
28-
{ title: 'COMMUNITY PARTNERS', url: '/partners' },
29-
{ title: 'OUR MODERATORS', url: '/moderators' }
24+
{ title: 'HOME', url: prefix+'/' },
25+
{ title: 'LEARN', url: prefix+'#' },
26+
{ title: 'BLOG', url: prefix+'/blog' },
27+
{ title: 'ABOUT', url: prefix+'#' },
28+
{ title: 'PROJECTS', url: prefix+'/projects' },
29+
{ title: 'COMMUNITY PARTNERS', url: prefix+'/partners' },
30+
{ title: 'OUR MODERATORS', url: prefix+'/moderators' }
3031
]
3132

3233
return (

constants/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const prefix = '/WebXDAO.github.io'
1+
export const prefix = process.env.NEXT_PUBLIC_BASE_PATH || ''

next.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
2-
basePath: '/WebXDAO.github.io',
3-
assetPrefix: '/WebXDAO.github.io',
2+
basePath: process.env.NEXT_PUBLIC_BASE_PATH,
3+
assetPrefix: process.env.NEXT_PUBLIC_BASE_PATH,
44
exportPathMap: function () {
55
return {
66
'/': { page: '/' }

0 commit comments

Comments
 (0)