Skip to content

Commit 82cc510

Browse files
committed
gh pages deployment
1 parent 6af904e commit 82cc510

File tree

3 files changed

+382
-15
lines changed

3 files changed

+382
-15
lines changed

chat/next.config.mjs

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,25 @@
11
/** @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+
26
const nextConfig = {
37
// Enable static exports
4-
output: 'export',
5-
8+
output: "export",
9+
610
// Disable image optimization since it's not supported in static exports
711
images: {
812
unoptimized: true,
913
},
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,
1223
};
1324

14-
export default nextConfig;
25+
export default nextConfig;

0 commit comments

Comments
 (0)