Repository navigation
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bbafea932b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return entry.name.startsWith('.') || entry.name === 'public' ? [] : redirectPages(path) | ||
| } | ||
| if (!entry.name.endsWith('.md')) return [] | ||
| return /^---\n(?:[^\n]*\n)*?title: Redirecting\n/.test(readFileSync(path, 'utf8')) |
There was a problem hiding this comment.
Accept CRLF when identifying redirect stubs
On Git-for-Windows checkouts using the common core.autocrlf=true, Markdown lines end in \r\n, so this LF-only regex fails at the opening ---\n and redirectPages() returns no redirect files. A pnpm build in that environment therefore puts all 152 redirect stubs back into llms.txt and llms-full.txt; parse the frontmatter or accept \r?\n so filtering is checkout-independent.
Useful? React with 👍 / 👎.
这个 PR 做什么
修复
https://docs.memoh.ai/llms.txt的两个问题:目录重复,以及混入旧路径的跳转页。agent 通过memoh-helpskill 读取这个目录来找文档页面,这两个问题会让它多读大量无效内容。Linear:MEMOH-207
原因
docs/.vitepress/{en,zh,ja,ru}.ts)都把/guides/、/integrations/、/self-hosted/三个 key 指向同一个references对象。vitepress-plugin-llms@1.14.0生成目录时会展开全部 key(Object.values(sidebar).flat()),同一个对象就输出了 3 次。网站本身只按当前路径取一个 sidebar,所以页面上看不出问题;llms-full.txt对文件做了去重,也不受影响。Redirecting:旧 URL 以 frontmatter 为title: Redirecting的空页面保留,页面里只有一段客户端跳转脚本。它们不在 sidebar 里,被插件归到了目录末尾的### Other。改动
只改
docs/.vitepress/config.ts中传给插件的配置,网站 sidebar 和页面内容都不变。[...new Set(Object.values(sidebar))].flat()。title: Redirecting的页面,通过ignoreFilesPerOutput从llms.txt和llms-full.txt中排除。插件按输出路径匹配目录下的index.md(channels/index.md对应channels.md),所以列表也做了同样的换算。以后新增跳转页会自动排除,不用手动维护名单。.md,旧链接的行为不变。验证
本地执行
pnpm build,对比修改前后在 main 上的构建产物:llms.txt大小llms.txt中Redirecting条目llms.txt各语言目录llms-full.txt页面数.md文件列表guides/container.html,除资源文件名的 hash 外与修改前一致。main 自身连续构建两次 hash 也会变化,这部分差异与本次改动无关。