-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
“BogdanDanilescu”
committed
Nov 29, 2024
1 parent
6069bf9
commit cb2d4f7
Showing
4 changed files
with
2 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,15 @@ | ||
import { withContentlayer } from 'next-contentlayer'; | ||
|
||
const isGitHubPages = Boolean(process.env.GITHUB_PAGES); | ||
const isNextExport = Boolean(process.env.NEXT_EXPORT); | ||
|
||
const prefix = isGitHubPages ? '/govie-ds' : undefined; | ||
|
||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = { | ||
reactStrictMode: true, | ||
trailingSlash: true, | ||
basePath: prefix, | ||
assetPrefix: prefix, | ||
output: isNextExport ? 'export' : 'standalone', | ||
images: { | ||
unoptimized: true, // TODO: review image optimisation | ||
}, | ||
publicRuntimeConfig: { | ||
basePath: prefix, | ||
}, | ||
}; | ||
|
||
export default withContentlayer(nextConfig); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,7 @@ | ||
import NextImage, { ImageProps } from 'next/image'; | ||
import { config } from '@/lib/config'; | ||
|
||
export function Image(props: ImageProps) { | ||
const imageSource = config.isGitHubPages() | ||
? `/govie-ds${props.src}` | ||
: props.src; | ||
const imageSource = props.src; | ||
|
||
return <NextImage {...props} src={imageSource} />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters