Skip to content
Draft
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
47 changes: 20 additions & 27 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,25 @@ clone:
depth: 1

steps:
- name: build
image: ruby:3.4
environment:
JEKYLL_ENV: production
BUNDLE_PATH: vendor/bundle
commands:
- bundle config mirror.https://rubygems.org https://mirrors.cloud.tencent.com/rubygems
- bundle install --verbose
- bundle exec jekyll build --trace --verbose --config _config.yml,_config.drone.yml
volumes:
- name: dist
path: /drone/src/_site
- name: vendor
path: /drone/src/vendor
- name: jekyll-cache
path: /drone/src/.jekyll-cache
when:
branch: [main]
- name: build
image: node:24-alpine
environment:
PUBLIC_SITE_URL: "https://docs.hmcl.net"
commands:
- npm install
- npm run build
volumes:
- name: dist
path: /drone/src/dist
- name: node_modules
path: /drone/src/node_modules
when:
branch: [main]

volumes:
- name: dist
host:
path: /home/ubuntu/docs.hmcl.net/www
- name: vendor
host:
path: /home/ubuntu/docs.hmcl.net/cache/vendor
- name: jekyll-cache
host:
path: /home/ubuntu/docs.hmcl.net/cache/jekyll-cache
- name: dist
host:
path: /home/ubuntu/docs.hmcl.net/www
- name: node_modules
host:
path: /home/ubuntu/docs.hmcl.net/cache/node_modules
5 changes: 2 additions & 3 deletions .github/workflows/gitee.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Sync to Gitee

on:
push
on: push

jobs:
run:
Expand All @@ -13,7 +12,7 @@ jobs:
with:
src: github/HMCL-dev
dst: gitee/huanghongxun
static_list: 'HMCL-docs'
static_list: "HMCL-docs"
force_update: true
debug: true
dst_key: ${{ secrets.GITEE_SYNC_BOT_PRIVATE_KEY }}
Expand Down
32 changes: 8 additions & 24 deletions .github/workflows/pr-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ concurrency:
cancel-in-progress: false
env:
GITHUB_PR_NUMBER: ${{ github.event_name == 'issue_comment' && github.event.issue.number || github.event.pull_request.number }}
JEKYLL_ENV: production
jobs:
cache-refresh:
if: ${{ !github.event.repository.fork && github.event_name == 'schedule' && github.event.schedule == '0 0 */6 * *' }}
Expand Down Expand Up @@ -201,15 +200,6 @@ jobs:
preview-create-build:
needs: preview-create-init
runs-on: ubuntu-latest
env:
PREVIEW_WATCH:
${{
contains(github.event.pull_request.labels.*.name, 'preview/watch') ||
contains(github.event.issue.labels.*.name, 'preview/watch') || (
github.event_name == 'issue_comment' &&
github.event.comment.body == '/preview watch'
)
}}
outputs:
artifact-id: ${{ steps.upload-site.outputs.artifact-id }}
steps:
Expand All @@ -224,22 +214,16 @@ jobs:
git fetch https://github.com/${{ needs.preview-create-init.outputs.repository }} ${{ needs.preview-create-init.outputs.sha }}
git merge --squash ${{ needs.preview-create-init.outputs.sha }} --no-edit
git commit -m "Merge #${{ env.GITHUB_PR_NUMBER }} for preview build"
- name: Setup Ruby
uses: ruby/setup-ruby@v1
- name: Setup Node
uses: actions/setup-node@v6
with:
ruby-version: "3.4"
bundler-cache: ${{ env.PREVIEW_WATCH }}
cache-version: PR-${{ env.GITHUB_PR_NUMBER }}
- name: Jekyll Build
node-version: 24
- name: Build
run: |
echo "url: https://${{ needs.preview-create-init.outputs.domain }}" > _action.yml
echo "baseurl: ${{ needs.preview-create-init.outputs.pathname }}/PR${{ env.GITHUB_PR_NUMBER }}" >> _action.yml
echo "source: ${{ github.workspace }}" >> _action.yml
echo "destination: /home/runner/site" >> _action.yml
echo "preview:" >> _action.yml
echo " pr-number: ${{ env.GITHUB_PR_NUMBER }}" >> _action.yml
${{ env.PREVIEW_WATCH }} || bundle install --jobs 4
bundle exec jekyll build --trace --config _config.yml,_action.yml
npm install
npm run build -- --outDir /home/runner/site
env:
PUBLIC_SITE_URL: https://${{ needs.preview-create-init.outputs.domain }}${{ needs.preview-create-init.outputs.pathname }}/PR${{ env.GITHUB_PR_NUMBER }}
- id: upload-site
name: Upload Site
uses: actions/upload-artifact@v4
Expand Down
35 changes: 27 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
_site
.sass-cache
.jekyll-cache
.jekyll-metadata
vendor
Gemfile.lock
.bundle
/.idea/
# build output
dist/
# generated types
.astro/

# dependencies
node_modules/

# logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# lock
package-lock.json
yarn.lock
pnpm-lock.yaml
bun.lock
bun.lockb

# environment variables
.env
.env.production

# macOS-specific files
.DS_Store
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.github/workflows/pr-preview.yml
15 changes: 15 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"printWidth": 100,
"semi": true,
"tabWidth": 2,
"trailingComma": "es5",
"plugins": ["prettier-plugin-astro"],
"overrides": [
{
"files": "*.astro",
"options": {
"parser": "astro"
}
}
]
}
4 changes: 4 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"recommendations": ["astro-build.astro-vscode", "esbenp.prettier-vscode", "unifiedjs.vscode-mdx"],
"unwantedRecommendations": []
}
11 changes: 11 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"version": "0.2.0",
"configurations": [
{
"command": "./node_modules/.bin/astro dev",
"name": "Development server",
"request": "launch",
"type": "node-terminal"
}
]
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"editor.tabSize": 2
}
8 changes: 0 additions & 8 deletions 404.md

This file was deleted.

36 changes: 0 additions & 36 deletions Gemfile

This file was deleted.

108 changes: 2 additions & 106 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,109 +1,5 @@
# HMCL-docs
# Hello Minecraft! Launcher 文档仓库

[![Build Status](https://drone.hmcl.net/api/badges/huanghongxun/HMCL-docs/status.svg)](https://drone.hmcl.net/huanghongxun/HMCL-docs)
本仓库用于托管 [Hello Minecraft! Launcher 文档站](https://docs.hmcl.net)的源代码,您可以通过对本仓库提交 Pull Request 的方式来为 HMCL 文档站贡献自己的力量!

Hello Minecraft! Launcher 帮助文档仓库

您可以通过对本仓库提交 Pull Request 的方式来为 HMCL 帮助文档贡献自己的力量!
本仓库内容使用 Attribution-NonCommercial 4.0 International (CC BY-NC 4.0) 协议(附带额外条款)开放,协议内容请参见 LICENSE 文件。

## 相关链接

[Hello Minecraft! Launcher 帮助文档仓库网站](https://docs.hmcl.net)

## Markdown

每篇文章由 Markdown 编写。如果你不知道什么是 Markdown,我们推荐你先大概了解一下这个排版工具。

我们推荐你使用 Typora 编写 Markdown 文章,该软件的使用方法和 Word 等传统文字排版软件相似,易于使用。

请注意,你在使用 Typora 时,请在 文件->偏好设置->图像 中,将 `插入图片时...` 选项修改为复制到指定路径为 `/assets/img/docs/${filename}` 目录

## 贡献

本仓库组织方式为一篇文章放在一个目录中。如果你要提交 PR,请不要将 md 文件直接放在根目录下。

每篇文章结构如下:
```
_<collection>/<article>.md

assets
* img
* docs
* <article>
* img1.png
* img2.png
* ...
```

其中,`<collection>` 表示集合,如 `multiplayer` 表示多人游戏、`modpack` 表示整合包,`<article>` 表示你的文章的英文唯一标识(尖括号表示占位符,不要直接提交 `<article>`,请确保其唯一且简短)请仅使用英文字母、数字、中划线、下划线字符作为唯一标识,不要使用空格、英文句点、中文字符。请确保资源文件夹名和 md 文件名一致,具体可以参考已有文章目录格式。

每篇文章由 Markdown 编写的 `<article>.md` 文件及附带图片组成(文章的图片请放置到 `/assets/img/docs/<article>` 目录中)在 Markdown 文件中请确保包含 [Front Matter](https://jekyllrb.com/docs/front-matter/) 其中应提供文章的一些元数据(如标题 `title` 更新日期 `date` 等)在 `_config.yml` 的 `defaults` 中配置有默认值的可以不指定。

### 添加新文章

添加新文章时,请确保将内容按照上述格式要求存放。你也可以参考已经写好的文章格式。

切记不要在一个添加新文章的 PR 里修改其他文章的内容。

### 修改已有文章

修改已有文章时,请确保你的 PR 仅修改一个文章内容,并在该文章里署名。

### 更新索引

在添加或修改文章后,请更新索引文件 `index.json`,以便 HMCL 展示你新添加的文件。

### 本地部署

项目是基于 Jekyll 实现的静态网站,使用 Minimal Mistakes 主题。

如果您想更深入的参与项目文档的维护,可参阅以下内容。

#### 前置条件

- `Ruby` 版本大于等于 `3.1` (项目构建版本 `3.4`)

#### 安装 bundle

> 环境中已安装 `bundle` 可跳过本节

```shell
gem install bundler
```

#### 下载源码

> 以 `git` 为例,您也可以通过 `github` 下载源码压缩包或其它方式下载源码。

```shell
# 克隆项目到本地
git clone https://github.com/HMCL-dev/HMCL-docs.git
# 进入项目根目录
cd HMCL-docs
```

#### 安装依赖

```shell
# 配置镜像(请自行根据网络环境决定是否需要使用镜像,此处以腾讯云镜像为例)
bundle config mirror.https://rubygems.org https://mirrors.cloud.tencent.com/rubygems
# 配置项目依赖安装路径
bundle config path vendor/bundle
# 安装项目依赖
bundle install
```

#### 启动本地开发服务器

```shell
bundle exec jekyll serve
```

#### 本地构建产物

> 根据需要配置环境变量,配置 `JEKYLL_ENV=production` 表示生产环境构建。

```shell
bundle exec jekyll build
```
13 changes: 0 additions & 13 deletions _changelog/dev.md

This file was deleted.

13 changes: 0 additions & 13 deletions _changelog/stable.md

This file was deleted.

Loading