Skip to content

Commit 9d51fc4

Browse files
committed
将文档构建工具迁移至 Starlight
1 parent 1d6dbb2 commit 9d51fc4

File tree

457 files changed

+2490
-3460
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

457 files changed

+2490
-3460
lines changed

.drone.yml

Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,25 @@ clone:
66
depth: 1
77

88
steps:
9-
- name: build
10-
image: ruby:3.4
11-
environment:
12-
JEKYLL_ENV: production
13-
BUNDLE_PATH: vendor/bundle
14-
commands:
15-
- bundle config mirror.https://rubygems.org https://mirrors.cloud.tencent.com/rubygems
16-
- bundle install --verbose
17-
- bundle exec jekyll build --trace --verbose --config _config.yml,_config.drone.yml
18-
volumes:
19-
- name: dist
20-
path: /drone/src/_site
21-
- name: vendor
22-
path: /drone/src/vendor
23-
- name: jekyll-cache
24-
path: /drone/src/.jekyll-cache
25-
when:
26-
branch: [main]
9+
- name: build
10+
image: node:24-alpine
11+
environment:
12+
PUBLIC_SITE_URL: "https://docs.hmcl.net"
13+
commands:
14+
- npm install
15+
- npm run build
16+
volumes:
17+
- name: dist
18+
path: /drone/src/dist
19+
- name: node_modules
20+
path: /drone/src/node_modules
21+
when:
22+
branch: [main]
2723

2824
volumes:
29-
- name: dist
30-
host:
31-
path: /home/ubuntu/docs.hmcl.net/www
32-
- name: vendor
33-
host:
34-
path: /home/ubuntu/docs.hmcl.net/cache/vendor
35-
- name: jekyll-cache
36-
host:
37-
path: /home/ubuntu/docs.hmcl.net/cache/jekyll-cache
25+
- name: dist
26+
host:
27+
path: /home/ubuntu/docs.hmcl.net/www
28+
- name: node_modules
29+
host:
30+
path: /home/ubuntu/docs.hmcl.net/cache/node_modules

.github/workflows/gitee.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
name: Sync to Gitee
22

3-
on:
4-
push
3+
on: push
54

65
jobs:
76
run:
@@ -13,7 +12,7 @@ jobs:
1312
with:
1413
src: github/HMCL-dev
1514
dst: gitee/huanghongxun
16-
static_list: 'HMCL-docs'
15+
static_list: "HMCL-docs"
1716
force_update: true
1817
debug: true
1918
dst_key: ${{ secrets.GITEE_SYNC_BOT_PRIVATE_KEY }}

.github/workflows/pr-preview.yml

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ concurrency:
1111
cancel-in-progress: false
1212
env:
1313
GITHUB_PR_NUMBER: ${{ github.event_name == 'issue_comment' && github.event.issue.number || github.event.pull_request.number }}
14-
JEKYLL_ENV: production
1514
jobs:
1615
cache-refresh:
1716
if: ${{ !github.event.repository.fork && github.event_name == 'schedule' && github.event.schedule == '0 0 */6 * *' }}
@@ -201,15 +200,6 @@ jobs:
201200
preview-create-build:
202201
needs: preview-create-init
203202
runs-on: ubuntu-latest
204-
env:
205-
PREVIEW_WATCH:
206-
${{
207-
contains(github.event.pull_request.labels.*.name, 'preview/watch') ||
208-
contains(github.event.issue.labels.*.name, 'preview/watch') || (
209-
github.event_name == 'issue_comment' &&
210-
github.event.comment.body == '/preview watch'
211-
)
212-
}}
213203
outputs:
214204
artifact-id: ${{ steps.upload-site.outputs.artifact-id }}
215205
steps:
@@ -224,22 +214,16 @@ jobs:
224214
git fetch https://github.com/${{ needs.preview-create-init.outputs.repository }} ${{ needs.preview-create-init.outputs.sha }}
225215
git merge --squash ${{ needs.preview-create-init.outputs.sha }} --no-edit
226216
git commit -m "Merge #${{ env.GITHUB_PR_NUMBER }} for preview build"
227-
- name: Setup Ruby
228-
uses: ruby/setup-ruby@v1
217+
- name: Setup Node
218+
uses: actions/setup-node@v6
229219
with:
230-
ruby-version: "3.4"
231-
bundler-cache: ${{ env.PREVIEW_WATCH }}
232-
cache-version: PR-${{ env.GITHUB_PR_NUMBER }}
233-
- name: Jekyll Build
220+
node-version: 24
221+
- name: Build
234222
run: |
235-
echo "url: https://${{ needs.preview-create-init.outputs.domain }}" > _action.yml
236-
echo "baseurl: ${{ needs.preview-create-init.outputs.pathname }}/PR${{ env.GITHUB_PR_NUMBER }}" >> _action.yml
237-
echo "source: ${{ github.workspace }}" >> _action.yml
238-
echo "destination: /home/runner/site" >> _action.yml
239-
echo "preview:" >> _action.yml
240-
echo " pr-number: ${{ env.GITHUB_PR_NUMBER }}" >> _action.yml
241-
${{ env.PREVIEW_WATCH }} || bundle install --jobs 4
242-
bundle exec jekyll build --trace --config _config.yml,_action.yml
223+
npm install
224+
npm run build -- --outDir /home/runner/site
225+
env:
226+
PUBLIC_SITE_URL: https://${{ needs.preview-create-init.outputs.domain }}${{ needs.preview-create-init.outputs.pathname }}/PR${{ env.GITHUB_PR_NUMBER }}
243227
- id: upload-site
244228
name: Upload Site
245229
uses: actions/upload-artifact@v4

.gitignore

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,27 @@
1-
_site
2-
.sass-cache
3-
.jekyll-cache
4-
.jekyll-metadata
5-
vendor
6-
Gemfile.lock
7-
.bundle
8-
/.idea/
1+
# build output
2+
dist/
3+
# generated types
4+
.astro/
5+
6+
# dependencies
7+
node_modules/
8+
9+
# logs
10+
npm-debug.log*
11+
yarn-debug.log*
12+
yarn-error.log*
13+
pnpm-debug.log*
14+
15+
# lock
16+
package-lock.json
17+
yarn.lock
18+
pnpm-lock.yaml
19+
bun.lock
20+
bun.lockb
21+
22+
# environment variables
23+
.env
24+
.env.production
25+
26+
# macOS-specific files
27+
.DS_Store

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.github/workflows/pr-preview.yml

.prettierrc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"printWidth": 100,
3+
"semi": true,
4+
"tabWidth": 2,
5+
"trailingComma": "es5",
6+
"plugins": ["prettier-plugin-astro"],
7+
"overrides": [
8+
{
9+
"files": "*.astro",
10+
"options": {
11+
"parser": "astro"
12+
}
13+
}
14+
]
15+
}

.vscode/extensions.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"recommendations": ["astro-build.astro-vscode", "esbenp.prettier-vscode", "unifiedjs.vscode-mdx"],
3+
"unwantedRecommendations": []
4+
}

.vscode/launch.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"command": "./node_modules/.bin/astro dev",
6+
"name": "Development server",
7+
"request": "launch",
8+
"type": "node-terminal"
9+
}
10+
]
11+
}

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"editor.tabSize": 2
3+
}

404.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)