Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Deploy Docs

on:
push:
branches:
- main
paths:
- docs/**
- .github/workflows/docs.yml
pull_request:
paths:
- docs/**
- .github/workflows/docs.yml
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 repository
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
cache-dependency-path: docs/pnpm-lock.yaml

- name: Install dependencies
working-directory: docs
run: pnpm install --frozen-lockfile

- name: Build docs
working-directory: docs
run: pnpm build

- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/dist

deploy:
if: github.event_name != 'pull_request'
needs: build
runs-on: ubuntu-latest

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ riderModule.iml
.godot/
*.user
.agent/
docs/images/
*.cs.uid
MinionLib.json
LocalSettings.props
Expand Down
19 changes: 11 additions & 8 deletions MinionLib.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@
<Reformat>false</Reformat>
</Language>
<Language id="CSS">
<Rearrange>false</Rearrange>
<Reformat>false</Reformat>
<Rearrange>false</Rearrange>
</Language>
<Language id="EditorConfig">
<Reformat>true</Reformat>
</Language>
<Language id="HTML">
<Rearrange>false</Rearrange>
<OptimizeImports>false</OptimizeImports>
<Reformat>false</Reformat>
<OptimizeImports>false</OptimizeImports>
<Rearrange>false</Rearrange>
</Language>
<Language id="HTTP Request">
<Reformat>false</Reformat>
Expand All @@ -58,19 +58,22 @@
<Reformat>false</Reformat>
</Language>
<Language id="JavaScript">
<Rearrange>false</Rearrange>
<OptimizeImports>false</OptimizeImports>
<Reformat>false</Reformat>
<OptimizeImports>false</OptimizeImports>
<Rearrange>false</Rearrange>
</Language>
<Language id="Markdown">
<Reformat>false</Reformat>
</Language>
<Language id="PowerShell">
<Reformat>true</Reformat>
</Language>
<Language id="Properties">
<Reformat>true</Reformat>
</Language>
<Language id="Python">
<OptimizeImports>true</OptimizeImports>
<Reformat>true</Reformat>
<OptimizeImports>true</OptimizeImports>
</Language>
<Language id="RELAX-NG">
<Reformat>false</Reformat>
Expand All @@ -88,9 +91,9 @@
<Reformat>false</Reformat>
</Language>
<Language id="XML">
<Rearrange>true</Rearrange>
<OptimizeImports>true</OptimizeImports>
<Reformat>true</Reformat>
<OptimizeImports>true</OptimizeImports>
<Rearrange>true</Rearrange>
</Language>
<Language id="yaml">
<Reformat>true</Reformat>
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

## 文档

- 快速入门:[docs/quickstart.md](./docs/quickstart.md)
[项目文档链接](https://fuynaloft.github.io/MinionLib)

## 许可证

Expand Down
21 changes: 21 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# build output
dist/
# generated types
.astro/

# 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
37 changes: 37 additions & 0 deletions docs/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// @ts-check
import {defineConfig} from 'astro/config';
import starlight from '@astrojs/starlight';

// https://astro.build/config
export default defineConfig({
site: 'https://fuynaloft.github.io',
base: '/MinionLib',
integrations: [
starlight({
title: 'MinionLib Docs',
defaultLocale: 'zh-cn',
locales: {
'zh-cn':{
label: '简体中文',
lang: 'zh-CN',
},
en:{
label: 'English',
lang: 'en',
}
},
sidebar: [
{
label: 'Quickstart',
translations: {
'zh-CN': '快速入门',
},
autogenerate: {
directory: 'quickstart',
},
},
],
social: [{icon: 'github', label: 'GitHub', href: 'https://github.com/FuYnAloft/MinionLib'}],
}),
],
});
17 changes: 17 additions & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "minionlib-docs",
"type": "module",
"version": "0.0.1",
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"build": "astro build",
"preview": "astro preview",
"astro": "astro"
},
"dependencies": {
"@astrojs/starlight": "^0.38.3",
"astro": "^6.0.1",
"sharp": "^0.34.2"
}
}
Loading
Loading