feat(site): 多语言架构 + 繁体(zh-Hant)站点#100
Merged
Merged
Conversation
把站点从写死 zh/en 重构为语言列表 LANGS 驱动,新增语言只需加一项 + 写一个 T.<code> 对象即可 drop-in。首个新增语言:繁体中文。 - LANGS 配置化:首页生成、skill 详情页、语言切换器、hreflang、 sitemap 全部按 LANGS 循环 - 语言切换器从二选一(中文↔EN)改为多语言链接 - render 分支由 `=== 'zh'` 改为 `=== 'en'`,非英文语言默认走中文内容 (繁体 skill 卡片/正文用中文,仅外壳翻译,与 en 站策略一致) - T.zht:手写繁体(台港自然用词:軟體/程式碼/專案/預設/除錯/計畫/ 全域/使用者/檔案 等;处理 發/後/裡/雲/麵 等一简对多繁),不引入 OpenCC 依赖 - 收尾日志按语言数动态输出 日文暂缓:公开营销文案需母语审校,避免机翻上线砸品牌。 测试:构建 63 页(3 语言 × (首页+20 skill));en/zh 站零回归; 繁体 htmlLang=zh-Hant、skill 卡片用中文标题、语言切换/hreflang/ sitemap 三语言齐全。
This was referenced Jul 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
你要解决什么问题?
站点此前只有中/英双语,写死在
build.mjs里。要「让更多人用」需要支持更多语言,但当前架构每加一种语言都要复制粘贴一大段生成逻辑。这个 PR 做了什么改变?
LANGS驱动——首页生成、skill 详情页、语言切换器、hreflang、sitemap 全部按LANGS循环。以后新增语言只需往LANGS加一项 + 写一个T.<code>翻译对象,drop-in。这个改变适合放在核心库中吗?
适合本 fork(站点是 fork 独有资产,多语言扩大触达)。纯
site/build.mjs改动,不碰上游任何文件、不碰 skills、零上游同步负担。你考虑了哪些替代方案?
T.ja即可(建议配母语审校或标注 beta)。SKILL.md(中文),繁体站沿用 en 站策略——外壳翻译、正文用中文(繁体读者读中文无碍)。这个 PR 是否包含多个不相关的改变?
否,单一主题:站点多语言化 + 繁体。
已有的 PR
测试环境
评估
站点是静态生成,构建即验证:
html lang="zh-Hant"、skill 卡片用中文标题(render 分支修复后非英文语言默认走中文内容)、繁体术语正确严格性
site/build.mjs)人工审核