Repository navigation
fix: 完善 SEO 元信息并修复窄屏详情侧栏状态 - #87
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: e3fac59704
ℹ️ 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".
| } | ||
| router.get('/api/seo',limiter,async(req,res)=>{const pathname=String(req.query.path||'/');if(!/^\/[a-zA-Z0-9/_%.-]*$/.test(pathname)||pathname.length>512)return res.status(400).json({message:'无效页面地址'});const result=await metadata(pathname,req.query);res.set('Cache-Control','no-store');res.status(result.status).json(result.meta);}); | ||
| router.get('/robots.txt',limiter,(_req,res)=>{res.type('text/plain').send(`User-agent: *\nDisallow: /api/\nAllow: /api/posts\nAllow: /api/projects\nAllow: /api/updates/\nAllow: /api/activity\nAllow: /api/now$\nAllow: /api/settings/site$\nAllow: /api/settings/blog-pages$\nAllow: /api/publishing/config$\nAllow: /api/subscriptions/status$\nAllow: /api/series\nAllow: /api/seo?\nSitemap: ${seo.origin()}/sitemap.xml\n`);}); | ||
| router.get('/robots.txt',limiter,(_req,res)=>{res.type('text/plain').send(`User-agent: *\nDisallow: /api/\nAllow: /api/uploads/\nAllow: /api/image-variants/\nAllow: /api/posts\nAllow: /api/projects\nAllow: /api/updates/\nAllow: /api/activity\nAllow: /api/now$\nAllow: /api/settings/site$\nAllow: /api/settings/blog-pages$\nAllow: /api/publishing/config$\nAllow: /api/subscriptions/status$\nAllow: /api/series\nAllow: /api/seo?\nSitemap: ${seo.origin()}/sitemap.xml\n`);}); |
There was a problem hiding this comment.
Keep non-image uploads out of the robots exception
Allow: /api/uploads/ overrides the preceding /api/ disallow for every nested upload, not only images. The repository mounts this directory with express.static in server/src/index.js, and server/src/lib/earlyAccessRelease.js places the potentially 512 MB PromptDock.dmg at /api/uploads/releases/PromptDock.dmg; whenever a crawler discovers that download URL, this change permits it to crawl the binary and consume substantial bandwidth. Add a more-specific disallow for /api/uploads/releases/ and any other non-image directories, or scope the exceptions to image resources.
Useful? React with 👍 / 👎.
公共列表页标题与描述过短,短文章摘要缺少正文上下文,公开图片被 robots.txt 的 /api/ 屏蔽。另有详情侧栏在窄屏初始化时被原生延迟 toggle 事件重新展开,导致详情浏览器检查超时。
本 PR 为各页生成明确、可区分的标题与描述;短摘要结合真实正文;近况筛选与分页区分元信息。robots.txt 仅放行支持的图片扩展名与响应式图片,明确禁止 releases 目录及非图片下载。详情侧栏由 React 统一控制,保留鼠标与 Enter/Space 操作及响应式切换。
验证:SEO 8 项通过;前端 66 项测试、类型检查、构建与体积预算通过;本地真实 Chromium 复现旧版详情测试超时,新版详情浏览器测试通过,新增 1099/1100px 切换和键盘展开/折叠回归。后端 270 项通过、33 项 MySQL 集成测试本地跳过;GitHub 首轮 MySQL 集成检查通过。更新提交已触发重新检查,最终以最新 CI 状态为准。
离线打包器支持 --with-frontend,包含两个 SEO 后端文件、匹配前端及 SSR runtime;部署校验 main/前版补丁基线、备份入口/runtime、失败回滚,仅重启 mooncci-api。无 Nginx、环境、数据库、依赖或邮件配置更改。
基于 main 7639899。IndexNow 未接入;未确定 Bing 抓取受限原因或完成旧域名 301 验收。