mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-05-07 00:39:00 +08:00
Merge pull request #194 from GeWuYou/feat/docs-init-vitepress-config
feat(docs): 初始化 GFramework 文档网站配置
This commit is contained in:
commit
3109beaa9b
@ -1,5 +1,26 @@
|
|||||||
import { defineConfig } from 'vitepress'
|
import { defineConfig } from 'vitepress'
|
||||||
|
|
||||||
|
const localSearch = {
|
||||||
|
provider: 'local' as const,
|
||||||
|
options: {
|
||||||
|
translations: {
|
||||||
|
button: {
|
||||||
|
buttonText: '搜索',
|
||||||
|
buttonAriaLabel: '搜索文档'
|
||||||
|
},
|
||||||
|
modal: {
|
||||||
|
noResultsText: '无法找到相关结果',
|
||||||
|
resetButtonTitle: '清除查询条件',
|
||||||
|
footer: {
|
||||||
|
selectText: '选择',
|
||||||
|
navigateText: '切换',
|
||||||
|
closeText: '关闭'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function safeGenericEscapePlugin() {
|
function safeGenericEscapePlugin() {
|
||||||
return {
|
return {
|
||||||
name: 'safe-generic-escape',
|
name: 'safe-generic-escape',
|
||||||
@ -62,6 +83,10 @@ export default defineConfig({
|
|||||||
chunkSizeWarningLimit: 1000
|
chunkSizeWarningLimit: 1000
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
themeConfig: {
|
||||||
|
// 在顶层保留搜索配置,避免构建期只读取站点级配置时把搜索入口裁掉。
|
||||||
|
search: localSearch
|
||||||
|
},
|
||||||
/** 多语言 */
|
/** 多语言 */
|
||||||
locales: {
|
locales: {
|
||||||
root: {
|
root: {
|
||||||
@ -71,41 +96,21 @@ export default defineConfig({
|
|||||||
|
|
||||||
themeConfig: {
|
themeConfig: {
|
||||||
logo: '/logo-icon.png',
|
logo: '/logo-icon.png',
|
||||||
|
search: localSearch,
|
||||||
search: {
|
|
||||||
provider: 'local',
|
|
||||||
options: {
|
|
||||||
translations: {
|
|
||||||
button: {
|
|
||||||
buttonText: '搜索文档',
|
|
||||||
buttonAriaLabel: '搜索文档'
|
|
||||||
},
|
|
||||||
modal: {
|
|
||||||
noResultsText: '无法找到相关结果',
|
|
||||||
resetButtonTitle: '清除查询条件',
|
|
||||||
footer: {
|
|
||||||
selectText: '选择',
|
|
||||||
navigateText: '切换',
|
|
||||||
closeText: '关闭'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
nav: [
|
nav: [
|
||||||
{ text: '首页', link: '/zh-CN/' },
|
{ text: '首页', link: '/zh-CN/' },
|
||||||
{ text: '入门指南', link: '/zh-CN/getting-started' },
|
{ text: '入门指南', link: '/zh-CN/getting-started' },
|
||||||
{ text: 'Core', link: '/zh-CN/core/' },
|
{ text: 'Core', link: '/zh-CN/core/' },
|
||||||
{ text: 'ECS', link: '/zh-CN/ecs/' },
|
|
||||||
{ text: 'Game', link: '/zh-CN/game/' },
|
{ text: 'Game', link: '/zh-CN/game/' },
|
||||||
{ text: 'Godot', link: '/zh-CN/godot/' },
|
{ text: 'Godot', link: '/zh-CN/godot/' },
|
||||||
{ text: '源码生成器', link: '/zh-CN/source-generators' },
|
|
||||||
{ text: '教程', link: '/zh-CN/tutorials/' },
|
{ text: '教程', link: '/zh-CN/tutorials/' },
|
||||||
{ text: '最佳实践', link: '/zh-CN/best-practices/' },
|
|
||||||
{
|
{
|
||||||
text: '更多',
|
text: '更多',
|
||||||
items: [
|
items: [
|
||||||
|
{ text: 'ECS', link: '/zh-CN/ecs/' },
|
||||||
|
{ text: '源码生成器', link: '/zh-CN/source-generators' },
|
||||||
|
{ text: '最佳实践', link: '/zh-CN/best-practices/' },
|
||||||
{ text: 'API 参考', link: '/zh-CN/api-reference' },
|
{ text: 'API 参考', link: '/zh-CN/api-reference' },
|
||||||
{ text: '常见问题', link: '/zh-CN/faq' },
|
{ text: '常见问题', link: '/zh-CN/faq' },
|
||||||
{ text: '故障排查', link: '/zh-CN/troubleshooting' },
|
{ text: '故障排查', link: '/zh-CN/troubleshooting' },
|
||||||
|
|||||||
@ -132,3 +132,46 @@
|
|||||||
--vp-custom-block-tip-code-bg: var(--vp-c-brand-soft);
|
--vp-custom-block-tip-code-bg: var(--vp-c-brand-soft);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Component: Navigation
|
||||||
|
* -------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
@media (min-width: 768px) and (max-width: 1279px) {
|
||||||
|
/* Keep the search entry visible on medium desktop widths where nav links are the tightest. */
|
||||||
|
.VPNavBarSearch {
|
||||||
|
flex: 0 0 auto;
|
||||||
|
padding-left: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.VPNavBarSearch .VPNavBarSearchButton {
|
||||||
|
min-width: 0;
|
||||||
|
padding: 8px 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.VPNavBarSearch .keys {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.VPNavBarMenu {
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.VPNavBarMenu .VPNavBarMenuLink,
|
||||||
|
.VPNavBarMenu .VPFlyout .button {
|
||||||
|
padding-left: 10px;
|
||||||
|
padding-right: 10px;
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 1280px) {
|
||||||
|
/* Reserve stable room for the search button before appearance and social actions appear. */
|
||||||
|
.VPNavBarSearch {
|
||||||
|
min-width: 176px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.VPNavBarSearch .VPNavBarSearchButton {
|
||||||
|
justify-content: space-between;
|
||||||
|
min-width: 176px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user