diff --git a/Gemfile b/Gemfile index a5f19101..d7ce7365 100644 --- a/Gemfile +++ b/Gemfile @@ -16,6 +16,7 @@ group :jekyll_plugins do gem "jekyll-gist", "1.5.0" gem "jekyll-feed", "0.17.0" gem "jekyll-include-cache", "0.2.1" + gem "jekyll-redirect-from", "0.16.0" end # Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem diff --git a/_config.yml b/_config.yml index 802dc845..96b4825c 100644 --- a/_config.yml +++ b/_config.yml @@ -17,9 +17,6 @@ sass: silence_deprecations: - import collections: - docs: - output: true - permalink: /:path:output_ext launcher: output: true permalink: /:collection/:path:output_ext @@ -31,9 +28,6 @@ collections: modpack: output: true permalink: /:collection/:path:output_ext - eula: - output: true - permalink: /:collection/:path:output_ext multiplayer: output: true permalink: /:collection/:path:output_ext @@ -66,13 +60,15 @@ plugins: - jekyll-gist - jekyll-feed - jekyll-include-cache + - jekyll-redirect-from # minimal-mistakes (mimic GitHub Pages with --safe) -# whitelist: -# - jekyll-paginate -# - jekyll-sitemap -# - jekyll-gist -# - jekyll-feed -# - jekyll-include-cache +whitelist: + - jekyll-paginate + - jekyll-sitemap + - jekyll-gist + - jekyll-feed + - jekyll-include-cache + - jekyll-redirect-from # Conversion # markdown: kramdown @@ -116,6 +112,38 @@ defaults: type: downloads values: toc: false + classes: wide + - scope: + path: _pages + type: pages + values: + toc: false + classes: wide + permalink: /:basename:output_ext + - scope: + path: _pages/changelogs/ + type: pages + values: + toc: true + classes: "" + layout: changelog + permalink: /changelogs/:basename:output_ext + - scope: + path: _pages/changelogs/dev + type: pages + values: + channel: dev + - scope: + path: _pages/changelogs/stable + type: pages + values: + channel: stable + - scope: + path: _pages/collections/ + type: pages + values: + layout: collection + permalink: /collections/:basename:output_ext # liquid: # error_mode: warn @@ -311,8 +339,6 @@ head_scripts: # jekyll-feed feed: collections: - - docs - launcher - modpack - - eula - multiplayer diff --git a/_data/hmcl.yml b/_data/hmcl.yml new file mode 100644 index 00000000..d827b360 --- /dev/null +++ b/_data/hmcl.yml @@ -0,0 +1,6 @@ +dev: + nowchange: 3.7.0.302 + # nowpreview: +stable: + nowchange: 3.6.20 + # nowpreview: diff --git a/_data/navigation.yml b/_data/navigation.yml index 40fe95c4..0a65fa98 100644 --- a/_data/navigation.yml +++ b/_data/navigation.yml @@ -1,18 +1,20 @@ main: - title: 常见问题 url: /faq.html + - title: 贡献指南 + url: /contribution.html + - title: 报错反馈 + url: /crash-support-group.html + - title: 用户交流 + url: /groups.html + - title: 用户协议 + url: /eula.html + - title: 帮助 + url: /help.html + - title: 更新日志 + url: /changelogs.html docs: - - title: 问题集合 - children: - - title: 常见问题 - url: /faq.html - - title: 启动器使用相关 - url: /launcher/ - - title: 整合包帮助 - url: /modpack/ - - title: 多人联机帮助 - url: /multiplayer/ - title: 使用者帮助 children: - title: 版本隔离 @@ -41,13 +43,21 @@ docs: - title: 添加默认 authlib-injector 验证服务器 url: /launcher/authlib-injector.html description: 本文将告诉你如何设置默认的验证服务器。 - - title: 其他 + - title: 文档集合 + children: + - title: 多人联机 + url: /collections/multiplayer.html + - title: 整合包 + url: /collections/modpack.html + - title: 启动器 + url: /collections/launcher.html + - title: 下载 + url: /collections/downloads.html + - title: 相关链接 children: - - title: 为 HMCL 做出贡献 - url: /contribution.html - - title: HMCL GitHub 地址 + - title: 项目官网 + url: https://hmcl.huangyuhui.net + - title: 项目仓库 url: https://github.com/HMCL-dev/HMCL - - title: HMCL 帮助文档 GitHub 地址 + - title: 文档仓库 url: https://github.com/HMCL-dev/HMCL-docs - - title: HMCL 官网 - url: https://hmcl.huangyuhui.net diff --git a/_docs/404.md b/_docs/404.md deleted file mode 100644 index a3a3fdd8..00000000 --- a/_docs/404.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -layout: splash ---- - -
-

404

-

页面不存在

-
diff --git a/_layouts/changelog.html b/_layouts/changelog.html index 02ae5514..2b2d479d 100644 --- a/_layouts/changelog.html +++ b/_layouts/changelog.html @@ -2,10 +2,16 @@ layout: document --- +{% assign root_version = '' %} {% assign channel = page.channel | default: 'stable' %} {% assign changelogs = site.changelogs | where_exp: "item", "item.relative_path contains channel" | reverse %} {% for item in changelogs %} + {% assign path = item.relative_path | split: '/' %} + {% if path[2] != root_version %} + {% assign root_version = path[2] %} +

HMCL {{ root_version }}

+ {% endif %} {% assign version = item.slug %} -

HMCL {{ version }}

+

HMCL {{ version }}

{{ item.content | markdownify }}
{% endfor %} diff --git a/_pages/404.md b/_pages/404.md new file mode 100644 index 00000000..96db8401 --- /dev/null +++ b/_pages/404.md @@ -0,0 +1,12 @@ +--- +layout: splash +title: 页面未找到 +--- + + + +# 页面未找到 + +抱歉,您尝试查看的页面不存在。 + + diff --git a/_pages/changelog/dev.md b/_pages/changelog/dev.md new file mode 100644 index 00000000..e665ef85 --- /dev/null +++ b/_pages/changelog/dev.md @@ -0,0 +1,22 @@ +--- +layout: compress +permalink: /changelog/dev.html +--- + + + + + +> [!NOTE] +> 该页面仅用于客户端获取更新日志 + + diff --git a/_pages/changelog/stable.md b/_pages/changelog/stable.md new file mode 100644 index 00000000..6af96bfb --- /dev/null +++ b/_pages/changelog/stable.md @@ -0,0 +1,22 @@ +--- +layout: compress +permalink: /changelog/stable.html +--- + + + + + +> [!NOTE] +> 该页面仅用于客户端获取更新日志 + + diff --git a/_pages/changelogs.md b/_pages/changelogs.md new file mode 100644 index 00000000..37271d11 --- /dev/null +++ b/_pages/changelogs.md @@ -0,0 +1,6 @@ +--- +title: 更新日志 +--- + +- [开发版更新日志](./changelogs/dev.html) +- [稳定版更新日志](./changelogs/stable.html) diff --git a/_changelog/dev.md b/_pages/changelogs/dev.md similarity index 62% rename from _changelog/dev.md rename to _pages/changelogs/dev.md index 6e392f78..a1b71618 100644 --- a/_changelog/dev.md +++ b/_pages/changelogs/dev.md @@ -1,8 +1,4 @@ --- -layout: changelog -channel: dev -nowchange: 3.7.0.302 -# nowpreview: title: 开发版更新日志 date: 2021-08-22 23:18:02 +0800 note: Changelogs are written in Chinese. diff --git a/_changelog/stable.md b/_pages/changelogs/stable.md similarity index 68% rename from _changelog/stable.md rename to _pages/changelogs/stable.md index 81b8ca2c..844336fa 100644 --- a/_changelog/stable.md +++ b/_pages/changelogs/stable.md @@ -1,7 +1,4 @@ --- -layout: changelog -nowchange: 3.6.20 -# nowpreview: title: 稳定版更新日志 date: 2021-08-22 23:18:02 +0800 note: Changelogs are written in Chinese. diff --git a/_pages/collections/changelog.md b/_pages/collections/changelog.md new file mode 100644 index 00000000..0ee1eae8 --- /dev/null +++ b/_pages/collections/changelog.md @@ -0,0 +1,4 @@ +--- +title: 更新日志 +collection: changelog +--- diff --git a/_pages/collections/docs.md b/_pages/collections/docs.md new file mode 100644 index 00000000..4a0a5de1 --- /dev/null +++ b/_pages/collections/docs.md @@ -0,0 +1,6 @@ +--- +title: 文档 +collection: docs +redirect_from: + - /docs/index.html +--- diff --git a/_pages/collections/downloads.md b/_pages/collections/downloads.md new file mode 100644 index 00000000..0e131460 --- /dev/null +++ b/_pages/collections/downloads.md @@ -0,0 +1,6 @@ +--- +title: 下载 +collection: downloads +redirect_from: + - /downloads/index.html +--- diff --git a/_pages/collections/launcher.md b/_pages/collections/launcher.md new file mode 100644 index 00000000..7616e49d --- /dev/null +++ b/_pages/collections/launcher.md @@ -0,0 +1,6 @@ +--- +title: 启动器 +collection: launcher +redirect_from: + - /launcher/index.html +--- diff --git a/_pages/collections/modpack.md b/_pages/collections/modpack.md new file mode 100644 index 00000000..19e7b37d --- /dev/null +++ b/_pages/collections/modpack.md @@ -0,0 +1,6 @@ +--- +title: 整合包 +collection: modpack +redirect_from: + - /modpack/index.html +--- diff --git a/_pages/collections/multiplayer.md b/_pages/collections/multiplayer.md new file mode 100644 index 00000000..45b1f8f3 --- /dev/null +++ b/_pages/collections/multiplayer.md @@ -0,0 +1,6 @@ +--- +title: 多人联机 +collection: multiplayer +redirect_from: + - /multiplayer/index.html +--- diff --git a/_docs/contribution.md b/_pages/contribution.md similarity index 91% rename from _docs/contribution.md rename to _pages/contribution.md index 1bb0c7df..e1a0e42c 100644 --- a/_docs/contribution.md +++ b/_pages/contribution.md @@ -1,5 +1,5 @@ --- -title: 为 HMCL 帮助文档出一份力 +title: 贡献指南 date: 2021-10-09 23:18:02 +0800 author: huanghongxun --- diff --git a/_docs/crash-support-group.md b/_pages/crash-support-group.md similarity index 85% rename from _docs/crash-support-group.md rename to _pages/crash-support-group.md index f9d93370..af59c637 100644 --- a/_docs/crash-support-group.md +++ b/_pages/crash-support-group.md @@ -12,6 +12,7 @@ author: zkitefly 由于加群人数过多,我们会移出问题已解决的用户。如果你在被移出后遇到了新的问题需要求助,你可以再次加群。 + diff --git a/_pages/docs.md b/_pages/docs.md deleted file mode 100644 index 4d961fc4..00000000 --- a/_pages/docs.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -title: 文档 -layout: collection -permalink: /docs/ -collection: docs -entries_layout: grid -classes: wide ---- \ No newline at end of file diff --git a/_pages/downloads.md b/_pages/downloads.md deleted file mode 100644 index 6fe3fd1b..00000000 --- a/_pages/downloads.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -title: 下载 -layout: collection -permalink: /downloads/ -collection: downloads -entries_layout: grid -classes: wide ---- \ No newline at end of file diff --git a/_eula/hmcl.md b/_pages/eula.md similarity index 98% rename from _eula/hmcl.md rename to _pages/eula.md index f562f5d6..bd551129 100644 --- a/_eula/hmcl.md +++ b/_pages/eula.md @@ -1,7 +1,9 @@ --- title: Hello Minecraft! Launcher 用户协议 date: 2021-09-21 23:26:00 +0800 -note: 更新时间 2021 年 9 月 21 日 +author: huanghongxun +redirect_from: + - /eula/hmcl.html --- 欢迎使用黄鱼(以下简称“开发者”)提供的 Hello Minecraft! Launcher(以下简称“本软件”)软件与服务。 为了保障用户(或称“您”)的权益,特制定本用户协议书(以下简称本协议)。 请您在使用本软件前,详细阅读本协议的所有内容。开发者可能随时更新本协议,本协议一旦发生变动,开发者将会在相关页面上通告修改内容。 修改后的本协议一旦在页面上公布即有效代替原用户协议书。 @@ -126,4 +128,4 @@ note: 更新时间 2021 年 9 月 21 日 3.在法律许可范围内,开发者享有对本协议条款的解释权; -4.用户可以通过电子邮件投诉、举报各类违法违规行为,邮件请发送至邮箱:hmcl@huangyuhui.net。 \ No newline at end of file +4.用户可以通过电子邮件投诉、举报各类违法违规行为,邮件请发送至邮箱:hmcl@huangyuhui.net。 diff --git a/_docs/faq.md b/_pages/faq.md similarity index 100% rename from _docs/faq.md rename to _pages/faq.md diff --git a/_docs/groups.md b/_pages/groups.md similarity index 100% rename from _docs/groups.md rename to _pages/groups.md diff --git a/_docs/help.md b/_pages/help.md similarity index 100% rename from _docs/help.md rename to _pages/help.md diff --git a/index.json b/_pages/index.json similarity index 99% rename from index.json rename to _pages/index.json index e7416c41..6f3b5142 100644 --- a/index.json +++ b/_pages/index.json @@ -1,3 +1,6 @@ +--- +layout: null +--- [ { "title": "启动器", diff --git a/_pages/index.md b/_pages/index.md new file mode 100644 index 00000000..19ad03be --- /dev/null +++ b/_pages/index.md @@ -0,0 +1,27 @@ +--- +title: 新手导航 +author: wifi-left +--- + +The articles are written in Simplified Chinese. If you'd like to help with translations, you're welcome to [submit a pull request](https://github.com/HMCL-dev/HMCL-docs/pulls). Alternatively, you can use your preferred translation tool to read them.\ +If you encounter a BUG, please report it promptly by [opening an issue](https://github.com/HMCL-dev/HMCL/issues). + + +如果您遇到 BUG,请及时在 [Issues](https://github.com/HMCL-dev/HMCL/issues) 页面提交反馈。 + + + diff --git a/_pages/launcher.md b/_pages/launcher.md deleted file mode 100644 index 3468e63f..00000000 --- a/_pages/launcher.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -title: 启动器 -layout: collection -permalink: /launcher/ -collection: launcher -entries_layout: grid -classes: wide ---- \ No newline at end of file diff --git a/_pages/modpack.md b/_pages/modpack.md deleted file mode 100644 index 5013c3fc..00000000 --- a/_pages/modpack.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -title: 整合包 -layout: collection -permalink: /modpack/ -collection: modpack -entries_layout: grid -classes: wide ---- \ No newline at end of file diff --git a/_pages/multiplayer.md b/_pages/multiplayer.md deleted file mode 100644 index 55a94497..00000000 --- a/_pages/multiplayer.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -title: 多人联机 -layout: collection -permalink: /multiplayer/ -collection: multiplayer -entries_layout: grid -classes: wide ---- diff --git a/index.md b/index.md deleted file mode 100644 index 3e39b437..00000000 --- a/index.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -title: HMCL 新手导航 -author: wifi-left ---- - -## 注意 Notice - -The articles were written in Simplified Chinese. If you want to help translate them, please send a pull request to [GitHub: HMCL-dev/HMCL-docs](https://github.com/HMCL-dev/HMCL-docs/pulls). Or you can enable your translation tool to read. - -If you encounter a BUG, please send feedback in time to [GitHub: huanghongxun/HMCL/issues](https://github.com/HMCL-dev/HMCL/issues). - -You can also submit your suggestions here. - -如果您遇到 BUG,请及时在 [GitHub: huanghongxun/HMCL/issues](https://github.com/HMCL-dev/HMCL/issues) 发送反馈。 - -您也可以在这里提交您的建议。 - -{% comment %} -此处的目录从 `_data/navigation.yml` 中的 docs 条目渲染,请修改该文件以更新目录 -{% endcomment %} -{% for group in site.data.navigation.docs %} -## {{ group.title }} - -{% for item in group.children %} -{{ forloop.index }}. [{{ item.title }}]({{ item.url }}) -{%- if item.description %} - - {{ item.description }} -{% endif %} -{% endfor %} -{% endfor %}