Skip to content

Commit

Permalink
chore: vuepress -> vitepress
Browse files Browse the repository at this point in the history
  • Loading branch information
KazariEX committed Feb 5, 2024
1 parent 84fbf7d commit 9863801
Show file tree
Hide file tree
Showing 18 changed files with 1,341 additions and 9,854 deletions.
5 changes: 4 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ charset = utf-8
indent_style = space
indent_size = 4
end_of_line = lf
trim_trailing_whitespace = true
trim_trailing_whitespace = true

[*.{md,yml}]
indent_size = 2
55 changes: 55 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Deploy VitePress site to Pages

on:
push:
branches: [master]

workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

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

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v2
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Install dependencies
run: pnpm install
- name: Build with VitePress
run: |
pnpm run docs:build
touch docs/.vitepress/dist/.nojekyll
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/.vitepress/dist

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
dist
node_modules
types
types

cache
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
shamefully-hoist=true
2 changes: 1 addition & 1 deletion deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -e
npm run docs:build

# 进入生成的文件夹
cd docs/.vuepress/dist
cd docs/.vitepress/dist

git init
git add -A
Expand Down
58 changes: 58 additions & 0 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import { defineConfig } from "vitepress";

export default defineConfig({
title: "ZAff",
description: "ES module for processing arcaea file format",
lang: "zh-CN",
base: "/zaff/",
themeConfig: {
nav: [
{
text: "主页",
link: "/"
},
{
text: "文档",
link: "/quick/"
},
{
text: "Github",
link: "https://github.com/KazariEX/zaff"
}
],
sidebar: [
{
text: "快速开始",
collapsed: false,
items: [
{
text: "简介",
link: "/quick/"
},
{
text: "安装",
link: "/quick/download"
},
{
text: "基础",
link: "/quick/base"
}
]
},
{
text: "进阶",
collapsed: false,
items: [
{
text: "缓动",
link: "/advance/easing"
}
]
}
],
footer: {
message: "MIT License",
copyright: "Copyright © 2023-2024 KazariEX"
}
}
});
38 changes: 0 additions & 38 deletions docs/.vuepress/config.js

This file was deleted.

3 changes: 0 additions & 3 deletions docs/.vuepress/package.json

This file was deleted.

8 changes: 0 additions & 8 deletions docs/README.md

This file was deleted.

6 changes: 5 additions & 1 deletion docs/advance/easing.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# 缓动
---
title: 缓动
---

# {{ $frontmatter.title }}

缓动是制作动画、提升谱面视觉效果的核心之一,ZAff 提供了一系列基本缓动函数,以及创建自定义缓动曲线的方法。按照以下方式导入:

Expand Down
11 changes: 11 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
layout: home
hero:
name: ZAff
text: 用于处理 Arcaea 谱面文件的 Node.js 库

actions:
- theme: brand
text: 快速上手
link: /quick/
---
3 changes: 0 additions & 3 deletions docs/quick/README.md

This file was deleted.

6 changes: 5 additions & 1 deletion docs/quick/base.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# 基础
---
title: 基础
---

# {{ $frontmatter.title }}

ZAff 使用 Aff 类来模拟一个 .aff 文件模块,并使用 Note 的衍生类等描述谱面的各种元素。首先,使用 ESModule 的语法引入:

Expand Down
6 changes: 5 additions & 1 deletion docs/quick/download.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# 安装
---
title: 安装
---

# {{ $frontmatter.title }}

通过以下方式安装ZAff。

Expand Down
7 changes: 7 additions & 0 deletions docs/quick/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: 简介
---

# {{ $frontmatter.title }}

欢迎使用ZAff。
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,22 @@
],
"exports": {
".": {
"import": "./dist/zaff.js",
"require": "./dist/zaff.cjs"
"import": "./dist/zaff.js",
"require": "./dist/zaff.cjs"
}
},
"packageManager": "[email protected]",
"scripts": {
"docs:deploy": "sh deploy.sh",
"docs:dev": "SET NODE_OPTIONS=--openssl-legacy-provider && vuepress dev docs --temp .temp",
"docs:build": "SET NODE_OPTIONS=--openssl-legacy-provider && vuepress build docs",
"docs:dev": "vitepress dev docs",
"docs:build": "vitepress build docs",
"build": "vite build -w",
"test": "vitest"
},
"devDependencies": {
"vite": "^5.0.12",
"vite-plugin-dts": "^3.7.2",
"vitest": "^1.2.2",
"vuepress": "^1.9.10"
"vitepress": "1.0.0-rc.41",
"vitest": "^1.2.2"
}
}
Loading

0 comments on commit 9863801

Please sign in to comment.