-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.mjs
More file actions
48 lines (40 loc) · 1.97 KB
/
next.config.mjs
File metadata and controls
48 lines (40 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import createMDX from '@next/mdx';
// ═══════════════════════════════════════════════════════════════════════════════
// Deployment configuration
//
// GitHub Pages (default github.io URL, no custom domain):
// • Set GITHUB_PAGES=true AND CUSTOM_DOMAIN=false in the CI workflow.
// • basePath is set to '/dkeramik' (your repository name) so that all
// asset references resolve correctly under the sub-path.
// • TODO: replace 'dkeramik' below with your actual repository name
// if it ever changes.
//
// GitHub Pages with a custom domain:
// • Set CUSTOM_DOMAIN=true in the CI workflow.
// • basePath is left empty — the site lives at the root of the domain.
// • Create a public/CNAME file containing your domain name (e.g. www.example.com).
//
// Local development / Vercel / other hosts:
// • Leave both env vars unset — no basePath is applied.
// ═══════════════════════════════════════════════════════════════════════════════
const isGitHubPages = process.env.GITHUB_PAGES === 'true';
const useCustomDomain = process.env.CUSTOM_DOMAIN === 'true';
/** @type {import('next').NextConfig} */
const nextConfig = {
output: 'export',
// basePath is only needed when serving under a sub-path (GitHub Pages without
// a custom domain). When using a custom domain or running locally, it stays
// empty so relative links and assets work at the root.
basePath: isGitHubPages && !useCustomDomain ? '/dkeramik' : '',
images: {
unoptimized: true,
},
pageExtensions: ['js', 'jsx', 'md', 'mdx', 'ts', 'tsx'],
};
const withMDX = createMDX({
options: {
remarkPlugins: [],
rehypePlugins: [],
},
});
export default withMDX(nextConfig);