Fix section 404 by rewriting README pages to index.html

Generate VitePress rewrites for subdirectory README.md and simplify Express page resolution.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-05 17:01:03 +08:00
parent c4f1fb94a1
commit 4a0851628a
4 changed files with 98 additions and 22 deletions
+2
View File
@@ -2,6 +2,7 @@ import path from 'node:path'
import { fileURLToPath } from 'node:url'
import { defineConfig } from 'vitepress'
import { missingAssetsPlugin } from './missing-assets-plugin.mjs'
import { generateRewrites } from './rewrites.mts'
import { generateSidebar } from './sidebar.mts'
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..')
@@ -11,6 +12,7 @@ export default defineConfig({
description: '传统文化典籍资料库',
lang: 'zh-CN',
srcDir: '.',
rewrites: generateRewrites(),
srcExclude: [
'**/node_modules/**',
'**/.vitepress/**',