refactor(site): migrate from Valaxy to VitePress - #377
Open
AdingApkgg wants to merge 13 commits into
Open
AdingApkgg wants to merge 13 commits into
AdingApkgg wants to merge 13 commits into
Conversation
Replace Valaxy 0.25.9 + valaxy-theme-press with VitePress 1.6.4, pnpm with Bun 1.4.2, and Node 22 with Node 24 LTS in CI. - Split the single-file bilingual pages into one file per language: Chinese in pages/ (site root), English in pages/en/ (/en/). The split was generated with markdown-it's own parser and checked token by token against the original structure. - Fix container nesting in 8 pages that hid content on the old site (e.g. the English "Notes" in 115_open, the Chinese tip in 189, mixed languages in the worker troubleshooting section) and two dead links. - Move page titles from frontmatter into a leading H1; the sidebar is generated from `categories` / `top` frontmatter in the same order as before. - Port contributors, giscus, BiliBili, download and WIP components, light/dark images, group icons and mermaid (own component, mermaid 12). - Redirect visitors to their preferred language on landing, honouring the old site's saved preference. - Replace Algolia with VitePress local search using Intl.Segmenter tokenization for Chinese. - Update README, CONTRIBUTING and the docs about writing docs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Biome 2.5 formats and lints the site code (TS, Vue script blocks, CSS, JSON) with the same style as the previous Prettier config. Prettier is kept for Markdown and YAML, which Biome does not support. - `bun run format` / `format:check` run Biome, then Prettier on *.md / *.yml; lint-staged does the same per file type. - Vue templates are not visible to Biome's stable Vue support, so the unused-variable/import rules are off for *.vue. - Fix the lint findings: `any` types, non-null assertions, `==`, global `isNaN`, assignment in return, `node:` import protocol. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Add `bun run typecheck` (vue-tsc + TypeScript 6.0.3). TypeScript 7 is not used yet: it drops the JS compiler API that vue-tsc needs. - OpenListDownload: move the Chinese-only download source row out of the `v-for` element into a `<template v-if>`, which also removes the empty filter row on English pages. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ESLint 10 (typescript-eslint, eslint-plugin-vue) lints the site code, including Vue templates. Prettier formats everything again, with the original config; eslint-config-prettier turns off conflicting rules. - `bun run lint` runs ESLint; `format` / `format:check` run Prettier; lint-staged runs `eslint --fix` + Prettier on code files. - Fix the findings: useless initial assignments, empty catch block, attribute order, missing prop defaults; document the two intentional `v-html` uses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The deploy workflow only runs on main and on PRs that touch it, so add a separate CI workflow that checks every PR. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
xrgzs
requested changes
Sep 27, 2026
xrgzs
left a comment
Member
There was a problem hiding this comment.
- 首页建议重构一下,不要用 VitePress 默认的
- 包管理器换回 pnpm,符合开发习惯
- 搜索继续使用Algolia
- Home: rebuild the old site's hero (floating logo, gradient name, the "Get Started" button whose text flies away as the logo flies in) as HomeHero.vue, with flowing light added: light running through the name, a spinning glow ring behind the logo and around the primary button, and a drifting aurora background. Animations are disabled for `prefers-reduced-motion`. - Package manager back to pnpm (12.6.0). CI uses pnpm/setup, which also installs Node.js from .nvmrc; esbuild's build script is allowed in pnpm-workspace.yaml. - Search back to Algolia, including the domain verification file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The light-mode palette and the primary button used deep teal / blue / indigo, which looked muddy. Use the old site's colors instead (teal-200, teal-300, sky-400) in both color modes and drop indigo; the primary button is back to the old #99f6e4 → #38bdf8 gradient. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
VitePress follows the system theme until the visitor clicks its light/dark toggle, and there is no way to go back to "system" except toggling to whatever the system uses. Replace VPSwitchAppearance (via the documented alias override, so the nav bar, the "…" menu and the mobile menu all get it) with a system / light / dark control. It writes VitePress's own `vitepress-theme-appearance` storage key through VueUse (same version as VitePress), which keeps VitePress's dark-mode state and the no-flash head script in sync. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
VitePress shows the whole nav menu from 768px on, but the seven items plus the search box overflowed by up to 126px until ~940px. In that range, collapse the search box to its icon and tighten the menu items. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
|
@xrgzs 感谢 review,三点都已处理:
另外顺带做了两处改动:
🤖 Generated with Claude Code |
"一个支持多种存储的文件列表程序,/ 由 Gin 和 SolidJS 强力驱动!" The hero keeps line breaks from the frontmatter, and the tagline font scales down on phones so each line still fits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
"A file list program that supports multiple storage, / powered by Gin and SolidJS!", matching the Chinese one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
|
A block left unclosed in the old single-file bilingual pages swallowed the next block of the other language, so these sections were never shown in that language (on the live site as well): - ecosystem (en): the jiwangyihao/olist-cdn-preheat entry - drivers/115 (zh): Python requirements and QR code steps for the Cookie script - drivers/thunder (en): the "3. Thunder X" section heading - installation/reverse-proxy (zh): step 1 of the aaPanel tutorial Also split the commented-out bilingual block in paas per language, say "based on VitePress" for the docs project in ecosystem, and add the missing separators there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4 of 5 tasks
Author
|
@ILoveScratch2 感谢 review,逐条回复: 1. 迁移规划 迁移之前我和 @cxw620 沟通过(2025 年 6 月)。当时我提的是用 Zola,他指出 Zola 的 i18n 和中文搜索有问题,而现有文档大量依赖 Vue,建议如果要换框架就一步到位用 VitePress,并没有反对。这个 PR 就是按这个方向做的。当然欢迎大家继续讨论,有顾虑可以直接在这里提。 2.
3. 中文页面与英文不同步 我在迁移前的原文里全面查了「某种语言的内容被嵌进另一种语言块」的问题,共 9 处,都已修复:115、115_open、189、thunder、reverse-proxy、ecosystem、desktop、worker、official_worker/guide、seeds/design。 仍有少量中英文不一致是原文本来就存在的,不是迁移引入的:
如果需要,我可以单独提 PR 补齐。 4. PR 体量 内容修复已经拆出来,按现在的 Valaxy 写法单独提交为 #380,不依赖迁移,可以先合并,直接修复现网。 #377 剩下的主要是:
提交也基本按主题分开。如果维护者更希望拆成多个 PR(比如把工具链和 CI 放到迁移之后再单独提),我可以再拆。 🤖 Generated with Claude Code |
This branch has not been deployed
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.
Description / 描述
将文档站从 Valaxy 迁移到 VitePress,并把工具链升级到最新稳定版。
HomeHero.vue)ci.yml:所有 PR 和 main 推送都会运行 format:check + lint + typecheck页面结构
pages/(站点根路径),英文在pages/en/(/en/)。title改为正文第一行的# 标题;侧边栏仍由categories/top生成,顺序与现网一致。功能
valaxy-lang);之后记住用户最后使用的语言。爬虫不会被跳转。顺带修复的内容问题
有 8 个页面的
:::容器嵌套写错,导致现网内容显示不正确::::直接显示成文字。另外 worker 首页的
./architecture、./faq本来就是死链,已改为指向./basic、./about。Review 建议
约 740 个文件的改动大部分是机械拆分和目录移动。需要重点看的是
.vitepress/下的配置与主题、package.json、CI workflow,以及上面提到的 8 个内容修复。Motivation and Context / 背景
Valaxy 已落后 14 个月(最新为 1.0.0-rc.15),并且依赖两个 patch。
中英文写在同一页里:HTML 固定为
lang="en"、标题只有英文、没有 hreflang,对 SEO 和搜索都不友好。构建耗时和内存:
旧站在 Node 25 上生成页面时会出错(devtools-kit 的
localStorage问题),但构建仍然返回成功,只产出 2 个 HTML。项目用户以国内为主,因此中文放在根路径。
测试
pnpm build通过:共 288 个页面,死链检查全部通过。VITE_BASE)分别构建,均成功。pnpm format:check(Prettier)、pnpm lint(ESLint)、pnpm typecheck(vue-tsc + TypeScript 6.0.3)通过。合并后需要在仓库外处理
lang: en,而且指向根路径;迁移后根路径是中文页面,英文页面在/en/。lang:zh-CN,英文为lang:en)。重新爬取之前,中文搜索没有结果,英文搜索会跳到中文页面。pnpm build,输出目录仍为dist。Checklist / 检查清单
我已阅读 CONTRIBUTING 文档。(本 PR 同时更新了该文档)
我已使用 prettier 或其他适当的格式化工具格式化提交的代码或文档。
我已为所有支持语言(包括中文和英文)更新文档内容。 (若适用)
我已确认编写的文档或代码格式正确, 无语法错误, 拼写错误。
我已相应更新了相关仓库(若适用)。(不适用)
🤖 Generated with Claude Code