Repository navigation
build: 构建时不再编译中文,产物仅保留英文站点 - #67
Merged
Merged
Conversation
中文文案与中文资源仍保留在仓库中,但不再参与构建,产物只有英文站点。 - i18n:只注册 en,移除语言检测与语言切换(Navbar 的切换按钮一并删除) - 路由 meta、Home/Features 截图固定使用英文版本 - 博客构建脚本只遍历 content/blog/en,blog-index.json 重新生成 - index.html 的 lang/description/og:locale/结构化数据改为英文 - 下载源默认值不再按语言随机(统一使用枫源镜像),下载源名称改为英文
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.
目标
按需求「不用彻底移出中文,在构建时不再编译中文即可」:中文文案、中文博客、中文截图都留在仓库里,只是不再进入构建产物。
改动
src/i18n/config.ts):只注册en,去掉语言检测与语言分支,<html lang>固定en。src/i18n/locales/zh.ts原样保留但不再被 import。src/components/Navbar.tsx):删除桌面端与移动端的语言切换按钮,保留主题切换。src/App.tsx):ROUTE_META/DEFAULT_META去掉zh/en双语结构,只留英文。HeroSection.tsx、FeaturesSection.tsx):固定取/image/en/*,移除中文截图兜底逻辑。public/image/zh/*保留。scripts/build-blog.ts):languages只遍历en;src/data/blog-index.json随之重新生成(只剩英文文章)。content/blog/zh/保留。index.html):lang="en",description / og:locale / structured data / title 改为英文。Download.tsx、useLatestRelease.ts):默认下载源不再按语言随机(统一枫源镜像),下载源名称与报错文案改为英文。为什么用「构建期排除」而不是删文件
zh.ts重新 import、languages加回'zh'、ROUTE_META补回中文即可,历史全部保留在 git 中。验证
Sitemap 与 blog-index 均为英文单语。