Skip to content

Conversation

@neveler
Copy link
Contributor

@neveler neveler commented Oct 3, 2025

支持多语言

预览 https://hmcl-docs.github.io

通过合并不同语言版本的产物实现多语言。

文档构建流程:

  • 构建多语言混合版本生成产物到 build/mixed 文件夹
  • 构建默认语言版本生成产物到 build/single 然后覆盖到 build/mixed 文件夹
  • 依次多语言版本( build/config.{lang}.yml)生成产物到 build/single 然后覆盖到 build/mixed 文件夹
  • 清空 _site 文件夹,并将 build/mixed 中合并后的产物复制到 _site 文件夹

改动

  • 添加站点 Logo hmcl.png 来自 HMCL 仓库。
  • 添加了部分文章的繁体中文、英语版本。
  • 优化 document 布局,新增页面属性 author contributors 用于表示页面创建者和贡献者。新增 default_language languages 属性,用于指定页面的默认语言及支持的语言列表。优化 note 属性,现已支持使用 markdown 作为属性值。
  • 添加 document-collection 布局,并为 _pages 下的文章默认启用。与 document 类似该布局支持 hits note author contributors 等。
  • 添加 index changelog 布局分别应用于首页于更新日志页。
  • 现在索引文件会自动生成,无需额外修改。

关联 ISSUES

@neveler

This comment was marked as resolved.

@zkitefly
Copy link
Member

zkitefly commented Oct 5, 2025

assets/img/hmcl/自动管理所有驱动器分页文件大小.webp
index.json

以上文件保留,其余可以删除

@neveler

This comment was marked as resolved.

@neveler neveler marked this pull request as draft October 5, 2025 10:22
@zkitefly
Copy link
Member

zkitefly commented Oct 6, 2025

现在会自动获取所有可见集合中的内容生成 index.json 文件,但有一个问题当前会对集合中的所有文章生成索引数据,是否需要排除一些文章?生成索引的逻辑:获取所有布局为 document-collection 且指定了 collection 属性的页面,通过这些页面的 collection 属性获取指定集合的所有文章并提取文章的 title description url 属性进而生成 json 索引文件。

将 下载 集合的文章排除就好

@neveler neveler marked this pull request as ready for review October 7, 2025 05:57
@neveler neveler mentioned this pull request Oct 11, 2025
@neveler neveler marked this pull request as draft October 14, 2025 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants