Skip to content

Commit 1214474

Browse files
committed
use astro
1 parent f2a4ddd commit 1214474

File tree

143 files changed

+7145
-15710
lines changed

Some content is hidden

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

143 files changed

+7145
-15710
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Deploy Manual
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: write
14+
15+
jobs:
16+
build:
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- uses: actions/checkout@v5
21+
with:
22+
fetch-depth: 0
23+
24+
- uses: actions/setup-node@v4
25+
with:
26+
node-version: 24
27+
cache: 'npm'
28+
29+
- name: Install dependencies
30+
run: npm ci
31+
working-directory: ./manual
32+
33+
- name: Build
34+
run: npm run build
35+
working-directory: ./manual
36+
37+
- name: Create nojekyll
38+
run: echo > ./manual/dist/.nojekyll
39+
40+
- name: Deploy to gh-pages branch
41+
uses: peaceiris/actions-gh-pages@v4
42+
with:
43+
github_token: ${{ secrets.GITHUB_TOKEN }}
44+
publish_branch: gh-pages
45+
publish_dir: ./manual/dist

manual/.gitignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
16+
# environment variables
17+
.env
18+
.env.production
19+
20+
# macOS-specific files
21+
.DS_Store

manual/README.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
该文件夹储存 LemonLime 用户手册源代码。
44

5-
用户手册使用 Typst 编写,源代码储存于 `docs` 目录中。
5+
用户手册使用 Typst 编写,源代码储存于 `manual/src/content` 目录中。
66

77
用户手册有两种分发模式:线上分发与线下分发。
88

@@ -13,10 +13,6 @@
1313
- [LXGW WenKai](https://github.com/lxgw/LxgwWenKai/releases)
1414
- [Courier Prime Code](https://quoteunquoteapps.com/courierprime/downloads/courier-prime-code.zip)
1515

16-
然后使用 Typst CLI 或者 Tinymist Typst 编译 `manual/docs/manual.typ`,将生成出来的 pdf 重命名并放在 `manual/llmanual.pdf`
16+
然后使用 Typst CLI 或者 Tinymist Typst 编译 `manual/src/content/manual.typ`,将生成出来的 pdf 重命名并放在 `manual/llmanual.pdf`
1717

18-
线上分发使用 pandoc 将 typst 文件转换为 md 文件,然后使用 [material for mkdocs](https://squidfunk.github.io/mkdocs-material/) 部署于线上。
19-
20-
转换工具存储于 `scripts/build_html.py` 中,需要 pandoc。在项目根目录下使用 `python ./manual/scripts/build_html.py` 调用。生成出来的文件在 `site` 目录下。
21-
22-
`docs` 文件夹已经使用 `.gitignore` 忽略除了 `index.md`(需要特殊处理主页) 外的 `.md` 文件。
18+
线上分发使用使用 astro+[astro-typst](https://github.com/OverflowCat/astro-typst)+[starlight theme](https://starlight.astro.build/) 部署于线上。

manual/astro.config.mjs

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// @ts-check
2+
import { defineConfig } from 'astro/config';
3+
import starlight from '@astrojs/starlight';
4+
import { typst } from 'astro-typst';
5+
6+
// https://astro.build/config
7+
export default defineConfig({
8+
site: 'https://project-lemonlime.github.io',
9+
base: 'Project_LemonLime',
10+
integrations: [
11+
starlight({
12+
title: 'LemonLime Manual',
13+
tableOfContents: false,
14+
favicon: '/favicon.png',
15+
social: [{ icon: 'github', label: 'GitHub', href: 'https://github.com/Project-LemonLime/Project_LemonLime' }],
16+
sidebar: [
17+
{
18+
label: 'Manual',
19+
items: [
20+
{ label: '快速开始', slug: 'quickstart' },
21+
{ label: '简介', slug: 'intro' },
22+
{ label: '安装', slug: 'install' },
23+
{ label: '设置', slug: 'settings' },
24+
{ label: '比赛', slug: 'contest' },
25+
{ label: '测试', slug: 'judge' },
26+
{ label: '比赛统计', slug: 'statistics' },
27+
{ label: '常见问题及回答', slug: 'issue' },
28+
],
29+
},
30+
],
31+
}),
32+
typst({
33+
options: {
34+
remPx: 14,
35+
},
36+
target: "html",
37+
}),
38+
],
39+
});

manual/docs/.gitignore

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

0 commit comments

Comments
 (0)