diff --git a/docs/.vitepress/cache/deps/_metadata.json b/docs/.vitepress/cache/deps/_metadata.json index 4b1af75..44658bc 100644 --- a/docs/.vitepress/cache/deps/_metadata.json +++ b/docs/.vitepress/cache/deps/_metadata.json @@ -1,25 +1,25 @@ { - "hash": "f04df328", - "configHash": "15e8eca7", + "hash": "74ecdc37", + "configHash": "1c302118", "lockfileHash": "42b6a898", - "browserHash": "342224e2", + "browserHash": "b3e735e5", "optimized": { "vue": { "src": "../../../node_modules/vue/dist/vue.runtime.esm-bundler.js", "file": "vue.js", - "fileHash": "c87f1bc4", + "fileHash": "5c6400c6", "needsInterop": false }, "vitepress > @vue/devtools-api": { "src": "../../../node_modules/@vue/devtools-api/dist/index.js", "file": "vitepress___@vue_devtools-api.js", - "fileHash": "4ddc9988", + "fileHash": "673694b5", "needsInterop": false }, "vitepress > @vueuse/core": { "src": "../../../node_modules/@vueuse/core/dist/index.js", "file": "vitepress___@vueuse_core.js", - "fileHash": "3d4a475e", + "fileHash": "7fde5c45", "needsInterop": false } }, diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index a93efd4..e78b637 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -1,53 +1,19 @@ import { defineConfig } from 'vitepress' export default defineConfig({ - title: "GFramework", - description: "面向游戏开发场景的模块化 C# 框架", - base: "/GFramework/", - vite: { - plugins: [ - { - name: 'catch-all-404', - configureServer(server) { - return () => { - server.middlewares.use((req, res, next) => { - const url = req.url || '' + title: 'GFramework', + description: '面向游戏开发场景的模块化 C# 框架', - // 排除这些路径 - const excludePaths = [ - '/@vite', - '/@fs', - '/node_modules', - '/__vite', - '/public' - ] + /** GitHub Pages / 子路径部署 */ + base: '/GFramework/', - // 如果是资源文件或特殊路径,跳过 - if (excludePaths.some(path => url.startsWith(path)) || - url.includes('.') || - url.startsWith('/GFramework/')) { - return next() - } - - // 其他路径重定向到 404 - res.writeHead(302, { Location: '/GFramework/404' }) - res.end() - }) - } - } - } - ], - server: { - strictPort: false, - // 添加中间件处理不带斜杠的情况 - proxy: {} - } - }, + /** 多语言 */ locales: { root: { label: '简体中文', lang: 'zh-CN', link: '/zh-CN/', + themeConfig: { logo: '/logo-icon.png', @@ -94,6 +60,7 @@ export default defineConfig({ ] } ], + '/zh-CN/core/': [ { text: 'Core 核心框架', @@ -107,6 +74,7 @@ export default defineConfig({ ] } ], + '/zh-CN/game/': [ { text: 'Game 游戏模块', @@ -119,6 +87,7 @@ export default defineConfig({ ] } ], + '/zh-CN/godot/': [ { text: 'Godot 集成', @@ -131,6 +100,7 @@ export default defineConfig({ ] } ], + '/zh-CN/source-generators/': [ { text: '源码生成器', @@ -142,6 +112,7 @@ export default defineConfig({ ] } ], + '/zh-CN/tutorials/': [ { text: '教程', @@ -152,6 +123,7 @@ export default defineConfig({ ] } ], + '/zh-CN/api-reference/': [ { text: 'API 参考', @@ -185,56 +157,6 @@ export default defineConfig({ next: '下一页' } } - }, - - // 未来添加英文版本时取消注释 - /* - en: { - label: 'English', - lang: 'en-US', - link: '/en/', - themeConfig: { - logo: '/logo-icon.png', - - search: { - provider: 'local' - }, - - nav: [ - { text: 'Home', link: '/en/' }, - { text: 'Getting Started', link: '/en/getting-started/installation' }, - { text: 'Core', link: '/en/core/overview' }, - { text: 'Game', link: '/en/game/overview' }, - { text: 'Godot', link: '/en/godot/overview' }, - { text: 'Source Generators', link: '/en/source-generators/overview' }, - { text: 'Tutorials', link: '/en/tutorials/basic-tutorial' }, - { text: 'API Reference', link: '/en/api-reference/core-api' } - ], - - sidebar: { - '/en/getting-started/': [ - { - text: 'Getting Started', - items: [ - { text: 'Installation', link: '/en/getting-started/installation' }, - { text: 'Quick Start', link: '/en/getting-started/quick-start' }, - { text: 'Architecture Overview', link: '/en/getting-started/architecture-overview' } - ] - } - ], - // ... 其他英文侧边栏配置 - }, - - socialLinks: [ - { icon: 'github', link: 'https://github.com/GeWuYou/GFramework' } - ], - - footer: { - message: 'Released under the Apache 2.0 License', - copyright: 'Copyright © 2026 GeWuYou' - } - } } - */ } -}) \ No newline at end of file +}) diff --git a/docs/404.md b/docs/404.md index bfca57e..8da3435 100644 --- a/docs/404.md +++ b/docs/404.md @@ -2,34 +2,37 @@ layout: page --- -
- Auto redirecting in {{ countdown }} seconds
- {{ countdown }} 秒后自动跳转
+
+ {{ countdown }} 秒后自动跳转
+
+
+ Auto redirecting in {{ countdown }} seconds
+