132 lines
6.4 KiB
TypeScript
132 lines
6.4 KiB
TypeScript
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: '<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><title>前往我的 GitHub 仓库</title><path d="M10,0 C15.523,0 20,4.59 20,10.253 C20,14.782 17.138,18.624 13.167,19.981 C12.66,20.082 12.48,19.762 12.48,19.489 C12.48,19.151 12.492,18.047 12.492,16.675 C12.492,15.719 12.172,15.095 11.813,14.777 C14.04,14.523 16.38,13.656 16.38,9.718 C16.38,8.598 15.992,7.684 15.35,6.966 C15.454,6.707 15.797,5.664 15.252,4.252 C15.252,4.252 14.414,3.977 12.505,5.303 C11.706,5.076 10.85,4.962 10,4.958 C9.15,4.962 8.295,5.076 7.497,5.303 C5.586,3.977 4.746,4.252 4.746,4.252 C4.203,5.664 4.546,6.707 4.649,6.966 C4.01,7.684 3.619,8.598 3.619,9.718 C3.619,13.646 5.954,14.526 8.175,14.785 C7.889,15.041 7.63,15.493 7.54,16.156 C6.97,16.418 5.522,16.871 4.63,15.304 C4.63,15.304 4.101,14.319 3.097,14.247 C3.097,14.247 2.122,14.234 3.029,14.87 C3.029,14.87 3.684,15.185 4.139,16.37 C4.139,16.37 4.726,18.2 7.508,17.58 C7.513,18.437 7.522,19.245 7.522,19.489 C7.522,19.76 7.338,20.077 6.839,19.982 C2.865,18.627 0,14.783 0,10.253 C0,4.59 4.478,0 10,0" fill="currentColor"></path></svg>'
|
|
},
|
|
link: 'https://github.com/ChiYuKe/ONIModTutorial',
|
|
ariaLabel: '前往 GitHub 仓库'
|
|
},
|
|
|
|
{
|
|
icon: {
|
|
svg: '<svg viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><title>我的Steam创意工坊</title><path d="M18.102 12.129c0-0 0-0 0-0.001 0-1.564 1.268-2.831 2.831-2.831s2.831 1.268 2.831 2.831c0 1.564-1.267 2.831-2.831 2.831-0 0-0 0-0.001 0h0c-0 0-0 0-0.001 0-1.563 0-2.83-1.267-2.83-2.83 0-0 0-0 0-0.001v0zM24.691 12.135c0-2.081-1.687-3.768-3.768-3.768s-3.768 1.687-3.768 3.768c0 2.081 1.687 3.768 3.768 3.768v0c2.080-0.003 3.765-1.688 3.768-3.767v-0zM10.427 23.76l-1.841-0.762c0.524 1.078 1.611 1.808 2.868 1.808 1.317 0 2.448-0.801 2.93-1.943l0.008-0.021c0.155-0.362 0.246-0.784 0.246-1.226 0-1.757-1.424-3.181-3.181-3.181-0.405 0-0.792 0.076-1.148 0.213l0.022-0.007 1.903 0.787c0.852 0.364 1.439 1.196 1.439 2.164 0 1.296-1.051 2.347-2.347 2.347-0.324 0-0.632-0.066-0.913-0.184l0.015 0.006zM15.974 1.004c-7.857 0.001-14.301 6.046-14.938 13.738l-0.004 0.054 8.038 3.322c0.668-0.462 1.495-0.737 2.387-0.737 0.001 0 0.002 0 0.002 0h-0c0.079 0 0.156 0.005 0.235 0.008l3.575-5.176v-0.074c0.003-3.12 2.533-5.648 5.653-5.648 3.122 0 5.653 2.531 5.653 5.653s-2.531 5.653-5.653 5.653h-0.131l-5.094 3.638c0 0.065 0.005 0.131 0.005 0.199 0 0.001 0 0.002 0 0.003 0 2.342-1.899 4.241-4.241 4.241-2.047 0-3.756-1.451-4.153-3.38l-0.005-0.027-5.755-2.383c1.841 6.345 7.601 10.905 14.425 10.905 8.281 0 14.994-6.713 14.994-14.994s-6.713-14.994-14.994-14.994c-0 0-0.001 0-0.001 0h0z" fill="currentColor"></path></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'
|
|
}
|
|
},
|
|
|
|
|
|
|
|
}
|
|
})
|