Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions docs/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,19 @@ import { createMDX } from "fumadocs-mdx/next"
const withMDX = createMDX()

const isCI = !!process.env.GITHUB_ACTIONS
const basePath = isCI ? '/evolution-sdk' : ''
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hardcoding '/evolution-sdk' makes the docs build fragile for repo renames and forks (GitHub Pages base path is typically /${repoName}). Consider deriving the base path from CI metadata (e.g., process.env.GITHUB_REPOSITORY/${repoName}) and/or allowing an explicit override via an env var, then use that computed value for basePath, assetPrefix, and env.NEXT_PUBLIC_BASE_PATH.

Suggested change
const basePath = isCI ? '/evolution-sdk' : ''
const explicitBasePath = process.env.DOCS_BASE_PATH
const inferredBasePath = process.env.GITHUB_REPOSITORY
? `/${process.env.GITHUB_REPOSITORY.split('/').pop()}`
: ''
const basePath = explicitBasePath ?? (isCI ? inferredBasePath : '')

Copilot uses AI. Check for mistakes.
/** @type {import('next').NextConfig} */
const config = {
reactStrictMode: true,
// required for GitHub Pages static export
output: 'export',
distDir: 'out',
// when running in CI for GitHub Pages, set basePath/assetPrefix
basePath: isCI ? '/evolution-sdk' : '',
assetPrefix: isCI ? '/evolution-sdk' : '',
basePath,
assetPrefix: basePath,
env: {
NEXT_PUBLIC_BASE_PATH: basePath,
},
Comment on lines +14 to +18
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hardcoding '/evolution-sdk' makes the docs build fragile for repo renames and forks (GitHub Pages base path is typically /${repoName}). Consider deriving the base path from CI metadata (e.g., process.env.GITHUB_REPOSITORY/${repoName}) and/or allowing an explicit override via an env var, then use that computed value for basePath, assetPrefix, and env.NEXT_PUBLIC_BASE_PATH.

Copilot uses AI. Check for mistakes.
trailingSlash: true,
images: {
unoptimized: true,
Expand Down
Loading