Skip to content

Commit

Permalink
♻️ 使用VitePress替换VuePress
Browse files Browse the repository at this point in the history
  • Loading branch information
fu050409 committed Dec 31, 2023
1 parent c3934f4 commit 5bb0e32
Show file tree
Hide file tree
Showing 30 changed files with 1,661 additions and 5,134 deletions.
25 changes: 18 additions & 7 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: docs
name: Deploy VitePress

on:
# 每当 push 到 main 分支时触发部署
Expand All @@ -7,12 +7,17 @@ on:
# 手动触发部署
workflow_dispatch:

concurrency:
group: pages
cancel-in-progress: false

jobs:
docs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4
with:
# “最近更新时间” 等 git 日志相关信息,需要拉取全部提交记录
fetch-depth: 0
Expand All @@ -22,12 +27,19 @@ jobs:
with:
# 选择要使用的 node 版本
node-version: 18
# 缓存 pnpm 依赖
- run: cd docs && npm install
cache: npm

- name: Setup Pages
uses: actions/configure-pages@v3

- name: Install dependencies
run: npm ci

# 运行构建脚本
- name: Build VuePress site
run: cd docs && npm run build
- name: Build with VitePress
run: |
npm run docs:build
touch docs/.vitepress/dist/.nojekyll
# 查看 workflow 的文档来获取更多信息
# @see https://github.com/crazy-max/ghaction-github-pages
Expand All @@ -42,4 +54,3 @@ jobs:
env:
# @see https://docs.github.com/cn/actions/reference/authentication-in-a-workflow\#about-the-github_token-secret
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ node_modules/
test.py
.idea
*.bak
*.log*
*.log*

docs/.vitepress/dist
docs/.vitepress/cache
14 changes: 0 additions & 14 deletions docs/.gitignore

This file was deleted.

101 changes: 101 additions & 0 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
import { defineConfig } from 'vitepress'

// https://vitepress.dev/reference/site-config
export default defineConfig({
lang: 'zh-CN',
title: "DicerGirl",
description: "新一代跨平台开源 TRPG 骰娘框架",

themeConfig: {
// https://vitepress.dev/reference/default-theme-config
nav: [
{
text: '概览',
link: '/overview/',
},
{
text: '开始',
link: '/getting-started/',
},
{
text: '指南',
link: '/usage/',
},
],

sidebar: [
{
text: '概览',
link: '/overview/',
},
{
text: '开始',
link: '/getting-started/',
items: [
{
text: '安装',
link: '/getting-started/installation.html',
},
{
text: '部署',
link: '/getting-started/deployment.html',
},
{
text: '使用',
link: '/getting-started/using-dicergirl.html',
},
]
},
{
text: '指南',
link: '/usage/',
items: [
{
text: '指令',
link: '/usage/commands/',
items: [
{
text: '管理指令',
link: '/usage/commands/manage.html',
},
{
text: '内置指令',
link: '/usage/commands/builtins.html',
},
{
text: '插件指令',
link: '/usage/commands/plugins.html',
},
]
},
]
},
],

docFooter: {
prev: '上一页',
next: '下一页'
},
lightModeSwitchTitle: '切换到日光模式',
darkModeSwitchTitle: '切换到黑暗模式',
sidebarMenuLabel: '目录',
returnToTopLabel: '返回顶部',
outline: {
label: "侧边栏"
},

editLink: {
pattern: 'https://github.com/noctisynth/dicer/edit/master/docs/:path',
text: '编辑此页'
},

socialLinks: [
{ icon: 'github', link: 'https://github.com/noctisynth/dicer/' }
],

footer: {
message: 'Released under the <a href="https://github.com/noctisynth/dicer/blob/master/LICENSE">Apache-2.0 License</a>.',
copyright: 'Copyright © 2011-present <a href="https://github.com/noctisynth/">Noctisynth, org</a>'
}
}
})
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
prev: ./installation.md
next: ./using-dicergirl.md
prev:
link: ./installation.md
next:
link: ./using-dicergirl.md
---
# 部署

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
prev: ../overview/README.md
next: ./installation.md
prev:
link: ../overview/index.md
next:
link: ./installation.md
---

# 快速开始
Expand All @@ -9,4 +11,4 @@ Noctisynth 注重于自由与开放,任何人都可以快速的部署 DicerGir

[安装](./installation.md)中,我们详细的阐述了如何从零开始搭建一个属于你的骰娘。

如果你已经有了一个 DicerGirl 安装,或者你非常熟悉 DicerGirl 的上层框架 Nonebot2,那么你可以直接移步[使用](./usage.md)
如果你已经有了一个 DicerGirl 安装,或者你非常熟悉 DicerGirl 的上层框架 Nonebot2,那么你可以直接移步[使用](./using-dicergirl.md)
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
prev: ./README.md
next: ./deployment.md
prev:
link: ./README.md
next:
link: ./deployment.md
---
# 安装

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
prev: ./deployment.md
next: ../usage/README.md
prev:
link: ./deployment.md
next:
link: ../usage/index.md
---
# 使用 DicerGirl

Expand All @@ -18,7 +20,7 @@ next: ../usage/README.md

如果你收到了机器人的回复:

```plain-text
```txt
Noctisynth DicerGirl 版本 3.5.2 [Python 3.12.0 For Nonebot2 2.1.2]
此项目以 Apache-2.0 协议开源.
欢迎使用 Noctisynth DicerGirl, 使用`.help 指令`查看指令帮助.
Expand Down
25 changes: 25 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
# https://vitepress.dev/reference/default-theme-home-page
layout: home
title: DicerGirl - 新一代跨平台 TRPG 骰娘框架

hero:
name: "DicerGirl"
text:
tagline: "新一代跨平台开源 TRPG 骰娘框架"
actions:
- theme: brand
text: 快速上手
link: /getting-started/
- theme: alt
text: 项目概览
link: /overview/

features:
- title: 高度自由
details: DicerGirl 是高度自由与高度可拓展的
- title: 模块系统
details: DicerGirl 模块遵循 Infini 标准,你可以自由的开发和增删模块
- title: 跨平台支持
details: 你可以在任何平台部署和使用 DicerGirl
---
5 changes: 3 additions & 2 deletions docs/src/overview/README.md → docs/overview/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
next: ../getting-started/README.md
next:
link: ../getting-started/index.md
---
# 概览

Expand Down Expand Up @@ -51,4 +52,4 @@ DicerGirl 不需要复杂的配置,如果你熟悉 Nonebot2,你可以快速
nb plugin install dicergirl
```

如果你对没点计算机使用的属性,我们还对计算机使用检定失败的玩家提供了在 Windows 平台快速部署的方案。它使用 DicerGirl Installer 安装并按照指引进行配置即可使用。如果你已经决定开始使用`DicerGirl`,请移步[快速开始](../getting-started/README.md)
如果你对没点计算机使用的属性,我们还对计算机使用检定失败的玩家提供了在 Windows 平台快速部署的方案。它使用 DicerGirl Installer 安装并按照指引进行配置即可使用。如果你已经决定开始使用`DicerGirl`,请移步[快速开始](../getting-started/index.md)
Loading

0 comments on commit 5bb0e32

Please sign in to comment.