From ca5b938882725ed9b3bdde00baab42f28ceb920f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=8F=B6?= <1936472877@qq.com> Date: Wed, 28 Feb 2024 21:02:55 +0800 Subject: [PATCH] init --- .github/workflows/deploy.yml | 68 ++++++++++++++++++++++++++++++++++++ .gitignore | 22 ++++++++++++ .vitepress/config.mts | 36 +++++++++++++++++++ README.md | 2 ++ api-examples.md | 49 ++++++++++++++++++++++++++ index.md | 25 +++++++++++++ package.json | 18 ++++++++++ start.md | 13 +++++++ 8 files changed, 233 insertions(+) create mode 100644 .github/workflows/deploy.yml create mode 100644 .gitignore create mode 100644 .vitepress/config.mts create mode 100644 README.md create mode 100644 api-examples.md create mode 100644 index.md create mode 100644 package.json create mode 100644 start.md diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..d780f05 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,68 @@ +# 构建 VitePress 站点并将其部署到 GitHub Pages 的示例工作流程 +# +name: Deploy VitePress site to Pages + +on: + # 在针对 `main` 分支的推送上运行。如果你 + # 使用 `master` 分支作为默认分支,请将其更改为 `master` + push: + branches: [docs] + + # 允许你从 Actions 选项卡手动运行此工作流程 + workflow_dispatch: + +# 设置 GITHUB_TOKEN 的权限,以允许部署到 GitHub Pages +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 # 如果未启用 lastUpdated,则不需要 + - uses: pnpm/action-setup@v2 # 如果使用 pnpm,请取消注释 + with: + version: 8.15.1 + # - uses: oven-sh/setup-bun@v1 # 如果使用 Bun,请取消注释 + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: pnpm # 或 pnpm / yarn + - name: Setup Pages + uses: actions/configure-pages@v4 + - name: Install dependencies + run: pnpm install # 或 pnpm install / yarn install / bun install + - name: Build with VitePress + run: | + pnpm run docs:build + touch .vitepress/dist/.nojekyll + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: .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 \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d045d14 --- /dev/null +++ b/.gitignore @@ -0,0 +1,22 @@ +# build output +dist/ + +# dependencies +node_modules/ + +# logs +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* + +# environment variables +.env +.env.production + +# macOS-specific files +.DS_Store + +# vitepress +docs/.vitepress/dist +docs/.vitepress/cache \ No newline at end of file diff --git a/.vitepress/config.mts b/.vitepress/config.mts new file mode 100644 index 0000000..799e13d --- /dev/null +++ b/.vitepress/config.mts @@ -0,0 +1,36 @@ +import { defineConfig } from 'vitepress' + +// https://vitepress.dev/reference/site-config +export default defineConfig({ + title: "Shiranai-Plugin", + description: "希腊奶文档", + themeConfig: { + // https://vitepress.dev/reference/default-theme-config + editLink: { + pattern: 'https://github.com/XasYer/ws-plugin-docs/tree/docs/:path', + text: '编辑此页面' + }, + nav: [ + { text: 'Home', link: '/' }, + { text: 'Examples', link: '/markdown-examples' } + ], + search: { + provider: 'local' + }, + sidebar: [ + { + text: 'Examples', + items: [ + { text: '快速开始', link: '/start' }, + { text: 'Runtime API Examples', link: '/api-examples' } + ] + } + ], + + socialLinks: [ + { icon: 'github', link: 'https://github.com/XasYer/Shiranai-Plugin' } + ], + }, + cleanUrls: true, + base: '/Shiranai-Plugin/' +}) diff --git a/README.md b/README.md new file mode 100644 index 0000000..1010984 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# Shiranai-Plugin docs +Shiranai-Plugin for TRSS-Yunzai & QQBot-Plugin \ No newline at end of file diff --git a/api-examples.md b/api-examples.md new file mode 100644 index 0000000..6bd8bb5 --- /dev/null +++ b/api-examples.md @@ -0,0 +1,49 @@ +--- +outline: deep +--- + +# Runtime API Examples + +This page demonstrates usage of some of the runtime APIs provided by VitePress. + +The main `useData()` API can be used to access site, theme, and page data for the current page. It works in both `.md` and `.vue` files: + +```md + + +## Results + +### Theme Data +
{{ theme }}
+ +### Page Data +
{{ page }}
+ +### Page Frontmatter +
{{ frontmatter }}
+``` + + + +## Results + +### Theme Data +
{{ theme }}
+ +### Page Data +
{{ page }}
+ +### Page Frontmatter +
{{ frontmatter }}
+ +## More + +Check out the documentation for the [full list of runtime APIs](https://vitepress.dev/reference/runtime-api#usedata). diff --git a/index.md b/index.md new file mode 100644 index 0000000..7f139e3 --- /dev/null +++ b/index.md @@ -0,0 +1,25 @@ +--- +# https://vitepress.dev/reference/default-theme-home-page +layout: home + +hero: + name: "Shiranai-Plugin" + # text: "希腊奶文档" + tagline: 专注于QQBot的游戏插件 + actions: + - theme: brand + text: 快速开始 + link: /start + - theme: alt + text: 游戏文档 + link: /api-examples + +features: + - title: 游戏 + details: 致力于大部分经典游戏 + - title: 按钮 + details: 使用按钮进行交互 + - title: Feature C + details: Lorem ipsum dolor sit amet, consectetur adipiscing elit +--- + diff --git a/package.json b/package.json new file mode 100644 index 0000000..9368fd1 --- /dev/null +++ b/package.json @@ -0,0 +1,18 @@ +{ + "name": "Shiranai-Plugin", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "docs:dev": "vitepress dev", + "docs:build": "vitepress build", + "docs:preview": "vitepress preview" + }, + "keywords": [], + "author": "", + "license": "MIT", + "devDependencies": { + "vitepress": "1.0.0-rc.44" + } +} \ No newline at end of file diff --git a/start.md b/start.md new file mode 100644 index 0000000..f0daa27 --- /dev/null +++ b/start.md @@ -0,0 +1,13 @@ +# 快速开始 + +阅读本文档立刻开始使用 + +## 安装插件 + +打开 `TRSS-Yunzai` 根目录执行以下命令 + +```sh +git clone --depth=1 https://github.com/XasYer/Shiranai-Plugin.git ./plugins/Shiranai-Plugin/ +pnpm install --filter=Shiranai-Plugin +``` +