File tree 2 files changed +7
-2
lines changed
2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 2
2
* @type {import('next').NextConfig }
3
3
*/
4
4
const nextConfig = {
5
- basePath : "/Next.js-and-GitHub-Pages-Example" ,
5
+ publicRuntimeConfig : {
6
+ basePath : "/Next.js-and-GitHub-Pages-Example" ,
7
+ } ,
6
8
output : "export" ,
7
9
images : {
8
10
loader : "akamai" ,
Original file line number Diff line number Diff line change @@ -2,8 +2,11 @@ import type { NextPage } from "next";
2
2
import Head from "next/head" ;
3
3
import Image from "next/image" ;
4
4
import styles from "../styles/Home.module.css" ;
5
+ import getConfig from "next/config" ;
5
6
6
7
const Home : NextPage = ( ) => {
8
+ const { publicRuntimeConfig } = getConfig ( ) ;
9
+
7
10
return (
8
11
< div className = { styles . container } >
9
12
< Head >
@@ -62,7 +65,7 @@ const Home: NextPage = () => {
62
65
Powered by{ " " }
63
66
< span className = { styles . logo } >
64
67
< Image
65
- src = "/Next.js-and-GitHub-Pages-Example/ vercel.svg"
68
+ src = { ` ${ publicRuntimeConfig . basePath } "/ vercel.svg"` }
66
69
alt = "Vercel Logo"
67
70
width = { 72 }
68
71
height = { 16 }
You can’t perform that action at this time.
0 commit comments