import { defineConfig } from 'vitepress'
// https://vitepress.dev/reference/site-config
export default defineConfig({
base: process.env.CF_PAGES ? '/' : '/ONIModTutorial/',
title: "ONIModTutorial",
description: "缺氧MOD教程",
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
nav: [
{ text: '首页', link: '/' },
{ text: '教程示例', link: '/markdown-examples' }
],
// 导航栏右侧的社交链接
socialLinks: [
{
icon: {
svg: ''
},
link: 'https://github.com/ChiYuKe/ONIModTutorial',
ariaLabel: '前往 GitHub 仓库'
},
{
icon: {
svg: ''
},
link: 'https://steamcommunity.com/profiles/76561199064454583/myworkshopfiles/?appid=457140',
ariaLabel: '查看我的 Steam 创意工坊'
}
],
sidebar: {
// 1. 默认侧边栏:显示在根目录及基础章节
'/': [
{
text: '01. 项目概述',
collapsed: false,
items: [
{ text: '开发引言', link: '/preface' },
{ text: '开发环境配置', link: '/development-environment' },
{ text: '游戏资产提取', link: '/asset-extraction' },
{ text: '游戏源码分析工具', link: '/dnspy-analysis' }
]
},
{
text: '02. 核心开发',
collapsed: false,
items: [
{ text: 'C# 基础与补丁语法', link: '/csharp-basics' },
{ text: 'Mod 结构', link: '/mod-structure' },
{ text: '第一个Mod', link: '/first-mod-tutorial' },
{ text: '编译流程扩展', link: '/build-and-debug' },
{ text: 'Unity篇', link: '/resource-unity' }
]
},
{
text: '03. 游戏内容扩展',
collapsed: true, // 在主站默认折叠,避免太长
items: [
{ text: '新增建筑', link: '/content/buildings' },
{ text: '新增植物', link: '/content/plants' },
{ text: '新增物品', link: '/content/items' },
{ text: '新增生物', link: '/content/creatures' },
{ text: '新增元素', link: '/content/elements' }
]
},
{
text: '04. 发布与维护',
collapsed: true,
items: [
{ text: 'Steam Workshop 上传', link: '/steam-workshop-upload' },
{ text: '多版本兼容性处理', link: '/version-compatibility' },
{ text: '开源协议与社区规范', link: '/community-guidelines' }
]
},
{
text: '05. 其他',
collapsed: true,
items: [
{ text: '贡献者名单', link: '/contributors' },
{ text: '加入贡献', link: '/contribute' },
{ text: '新闻公告', link: '/announcements' },
{ text: '创意工坊', link: '/workshop-list' }
]
}
],
// 2. 内容扩展专用侧边栏
'/content/': [
{
text: '🏗️ 游戏内容扩展',
items: [
{ text: '← 返回教程主页', link: '/preface' },
{ text: '新增建筑 (Buildings)', link: '/content/buildings' },
{ text: '新增植物 (Plants)', link: '/content/plants' },
{ text: '新增物品 (Items)', link: '/content/items' },
{ text: '新增生物 (Creatures)', link: '/content/creatures' },
{ text: '新增元素 (Elements)', link: '/content/elements' }
]
}
]
},
editLink: {
pattern: 'https://github.com/ChiYuKe/ONIModTutorial/edit/main/:path',
text: '在 GitHub 上编辑此页'
},
search: {
provider: 'local'
},
lastUpdated: {
text: '最后更新于',
formatOptions: {
dateStyle: 'full',
timeStyle: 'medium'
}
},
}
})