From ddd379ddbd3b983ac6e155fe527f5c6ddc917b1c Mon Sep 17 00:00:00 2001
From: Alvin <154572722+alvinng4@users.noreply.github.com>
Date: Mon, 29 Dec 2025 20:35:32 +0800
Subject: [PATCH 1/2] [Website] Fix website prefix issue & add color to search
highlight
---
website/app/layout.tsx | 6 ++++--
website/components/nextra-search-dialog.tsx | 6 ++++--
website/next.config.mjs | 8 ++++----
website/package.json | 11 ++++++-----
website/prefix.ts | 3 +++
5 files changed, 21 insertions(+), 13 deletions(-)
create mode 100644 website/prefix.ts
diff --git a/website/app/layout.tsx b/website/app/layout.tsx
index 126ad5c..39f15a1 100644
--- a/website/app/layout.tsx
+++ b/website/app/layout.tsx
@@ -6,6 +6,8 @@ import {Metadata} from "next";
import {NextraSearchDialog} from "@/components/nextra-search-dialog";
import {getPagesFromPageMap} from "@/lib/getPagesFromPageMap";
+import { prefix } from "@/prefix";
+
export const metadata: Metadata = {
// Define your metadata here
// For more information on metadata API, see: https://nextjs.org/docs/app/building-your-application/optimizing/metadata
@@ -17,14 +19,14 @@ const navbar = (
logo={

- regex.test(part) ?
{part} : part
+ regex.test(part) ?
{part} : part
);
}
@@ -358,7 +360,7 @@ declare global {
async function importPagefind() {
if (window.pagefind) return;
window.pagefind = await import(
- /* webpackIgnore: true */ addBasePath('/_pagefind/pagefind.js')
+ /* webpackIgnore: true */ addBasePath(`${prefix}/_pagefind/pagefind.js` )
);
await window.pagefind.options({
baseUrl: '/'
diff --git a/website/next.config.mjs b/website/next.config.mjs
index 27e7173..fb9bbea 100644
--- a/website/next.config.mjs
+++ b/website/next.config.mjs
@@ -1,17 +1,17 @@
import nextra from "nextra";
+import { prefix } from "./prefix.ts";
+
const withNextra = nextra({
search: true,
defaultShowCopyCode: true,
});
-const isProd = process.env.NODE_ENV === 'production'
-
/** @type {import('next').NextConfig} */
const nextConfig = {
output: 'export',
- basePath: isProd ? '/c_traceback' : '',
- assetPrefix: isProd ? '/c_traceback/' : '',
+ basePath: prefix,
+ assetPrefix: prefix,
images: { unoptimized: true }
}
diff --git a/website/package.json b/website/package.json
index 650aa54..d14f96f 100644
--- a/website/package.json
+++ b/website/package.json
@@ -1,7 +1,8 @@
{
"name": "nextra-docs-starter",
- "version": "1.0.0",
- "description": "Nextra docs starter with search included.",
+ "version": "0.0.1",
+ "description": "A colorful, lightweight error-propagation framework for C.",
+ "type": "module",
"scripts": {
"dev": "next dev",
"build": "next build",
@@ -10,14 +11,14 @@
},
"repository": {
"type": "module",
- "url": "https://github.com/phucbm/nextra-docs-starter"
+ "url": "https://github.com/alvinng4/c_traceback"
},
"author": "PHUCBM",
"license": "MIT",
"bugs": {
- "url": "https://github.com/phucbm/nextra-docs-starter/issues"
+ "url": "https://github.com/alvinng4/c_traceback/issues"
},
- "homepage": "https://github.com/phucbm/nextra-docs-starter#readme",
+ "homepage": "https://github.com/alvinng4/c_traceback#readme",
"dependencies": {
"@radix-ui/react-dialog": "^1.1.15",
"@tailwindcss/postcss": "^4.1.18",
diff --git a/website/prefix.ts b/website/prefix.ts
new file mode 100644
index 0000000..4b0530c
--- /dev/null
+++ b/website/prefix.ts
@@ -0,0 +1,3 @@
+const isProd = process.env.NODE_ENV === 'production';
+const prefix = isProd ? '/c_traceback' : '';
+export { prefix };
\ No newline at end of file
From d6aec0aedbd58203a6945795fd3e79bd9b5bf0e3 Mon Sep 17 00:00:00 2001
From: Alvin <154572722+alvinng4@users.noreply.github.com>
Date: Mon, 29 Dec 2025 20:37:36 +0800
Subject: [PATCH 2/2] Update pr-build.yml
---
.github/workflows/pr-build.yml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml
index 36003bf..6411a05 100644
--- a/.github/workflows/pr-build.yml
+++ b/.github/workflows/pr-build.yml
@@ -4,10 +4,11 @@ on:
pull_request:
branches:
- main
+ paths:
+ - 'website/**'
jobs:
build:
- if: github.head_ref == 'website'
runs-on: ubuntu-latest
steps: