mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-05-07 10:08:50 -05:00
Without trailingSlash, Next's static export emits /practice.html, but the dev preview at harvard-edge.github.io/cs249r_book_dev/staffml is linked into the surrounding Quarto book — any URL like /staffml/practice/ (trailing slash) doesn't match practice.html, so GitHub Pages falls through to the Quarto-rendered 404 page. With trailingSlash: true, Next emits practice/index.html and GitHub Pages serves both the with- and without-slash forms (auto-redirecting no-slash to with-slash). Verified by building locally: out/practice/index.html, out/explore/index.html, out/gauntlet/index.html now exist; no orphan practice.html at the root. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
24 lines
895 B
JavaScript
24 lines
895 B
JavaScript
import path from 'path';
|
|
|
|
/** @type {import('next').NextConfig} */
|
|
const nextConfig = {
|
|
output: 'export',
|
|
// Emit `<page>/index.html` instead of `<page>.html` so GitHub Pages serves
|
|
// trailing-slash URLs (e.g. /staffml/practice/) correctly. Without this the
|
|
// dev preview returns 404 for any deep link with a trailing slash, which
|
|
// falls through to the surrounding Quarto book's 404 template.
|
|
trailingSlash: true,
|
|
images: { unoptimized: true },
|
|
poweredByHeader: false,
|
|
// When deployed to a subdirectory (e.g. /interviews/), set NEXT_PUBLIC_BASE_PATH=/interviews
|
|
basePath: process.env.NEXT_PUBLIC_BASE_PATH || '',
|
|
outputFileTracingRoot: path.join(process.cwd(), '../../'),
|
|
eslint: {
|
|
// Warning: This allows production builds to successfully complete even if
|
|
// your project has ESLint errors.
|
|
ignoreDuringBuilds: true,
|
|
},
|
|
};
|
|
|
|
export default nextConfig;
|