File tree Expand file tree Collapse file tree 3 files changed +382
-15
lines changed Expand file tree Collapse file tree 3 files changed +382
-15
lines changed Original file line number Diff line number Diff line change 1
1
/** @type {import('next').NextConfig } */
2
+ const isGitHubPages = process . env . GITHUB_PAGES === "true" ;
3
+ const repo = "agentapi" ;
4
+ const subPath = "chat" ; // Subdirectory within the repo
5
+
2
6
const nextConfig = {
3
7
// Enable static exports
4
- output : ' export' ,
5
-
8
+ output : " export" ,
9
+
6
10
// Disable image optimization since it's not supported in static exports
7
11
images : {
8
12
unoptimized : true ,
9
13
} ,
10
-
11
- // Remove headers config for static export
14
+
15
+ // Configure base path for GitHub Pages (repo/chat)
16
+ basePath : isGitHubPages ? `/${ repo } /${ subPath } ` : "" ,
17
+
18
+ // Configure asset prefix for GitHub Pages - helps with static asset loading
19
+ assetPrefix : isGitHubPages ? `/${ repo } /${ subPath } /` : "" ,
20
+
21
+ // Configure trailing slashes (recommended for static exports)
22
+ trailingSlash : true ,
12
23
} ;
13
24
14
- export default nextConfig ;
25
+ export default nextConfig ;
You can’t perform that action at this time.
0 commit comments