-
Notifications
You must be signed in to change notification settings - Fork 24
fix(docs): expose NEXT_PUBLIC_BASE_PATH so blueprint sample fetch works on GitHub Pages #218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,15 +3,19 @@ import { createMDX } from "fumadocs-mdx/next" | |
| const withMDX = createMDX() | ||
|
|
||
| const isCI = !!process.env.GITHUB_ACTIONS | ||
| const basePath = isCI ? '/evolution-sdk' : '' | ||
| /** @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
|
||
| trailingSlash: true, | ||
| images: { | ||
| unoptimized: true, | ||
|
|
||
There was a problem hiding this comment.
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 forbasePath,assetPrefix, andenv.NEXT_PUBLIC_BASE_PATH.