✨ refactor(wiki): migrate to content collection#35
Merged
nick-cjyx9 merged 4 commits intoopen-ani:mainfrom Feb 9, 2026
Merged
Conversation
- Replace `remark-anchor-link` with `rehype-autolink-headings`. Handle anchor links at the rehype layer to avoid affecting Markdown headings in Astro - Add `rehypeHeadingIds` from `@astrojs/markdown-remark` to ensure heading ids are available
- Define a `wiki` content collection and move wiki Markdown files to `src/content/wiki/` - Rename files to English slugs for improved SEO - Add an `order` field in frontmatter to support custom navigation sorting - Refine `Doc.astro` UIs, and use generated headings
57d5400 to
0ffce7c
Compare
Contributor
|
话说有没有什么方法可以让toc跳转不使用锚点(即#)进行页面内跳转,这样子浏览记录会爆炸的 |
Member
之前手动往 history push 了记录,删掉那行 |
maxchang3
commented
Feb 9, 2026
Contributor
Author
|
Squash 成一个 commit 吧 |
Member
|
ok |
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.
使用 Content Collection 重构了文档(
wiki)页面。remark-anchor-link替换为 Astro 官方推荐的rehype-autolink-headings。在 rehype 层处理锚点链接,避免影响 Astro 在 Markdown 相关的 API 中获取到的heading.text12。实际中,前者会在生成的heading.text的结果前添加一个#。@astrojs/markdown-remark中的rehypeHeadingIds,确保标题 ID 可以被上述插件访问3wiki内容集合:order字段以支持自定义导航排序。Doc.astro界面,移除动态目录生成逻辑,使用生成的headings,优化用户体验。Footnotes
https://docs.astro.build/en/guides/markdown-content/#importing-markdown ↩
https://docs.astro.build/en/reference/modules/astro-content/#render ↩
https://docs.astro.build/en/guides/markdown-content/#heading-ids-and-plugins ↩