add missing canonical and og:image meta across pages - #320
Conversation
|
Warning Review limit reached
Next review available in: 1 minute Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthrough此變更統一頁面 canonical 與 description metadata,並更新部落格、首頁、法律頁及邀請頁的 Open Graph 圖片、標題與描述輸出。 ChangesSEO metadata
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Deploying website with
|
| Latest commit: |
ce67aeb
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://37577222.website-bmk.pages.dev |
| Branch Preview URL: | https://fix-seo-meta.website-bmk.pages.dev |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/legal-layout.tsx (1)
25-34: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value合併條件渲染以簡化程式碼。
這裡重複了兩次
{page.data.description && ...}的條件判斷。建議將這兩個 meta 標籤合併到同一個 Fragment 中,讓程式碼更簡潔並減少重複。💡 建議的重構方式
<title>{`${page.data.title} - Yeecord`}</title> <link rel="canonical" href={canonicalUrl(page.url)} /> <meta property="og:title" content={`${page.data.title} - Yeecord`} /> - {page.data.description && ( - <meta name="description" content={page.data.description} /> - )} - {page.data.description && ( - <meta property="og:description" content={page.data.description} /> - )} + {page.data.description && ( + <> + <meta name="description" content={page.data.description} /> + <meta property="og:description" content={page.data.description} /> + </> + )} <meta property="og:image" content={`${domain}/opengraph-image.png`} />🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/legal-layout.tsx` around lines 25 - 34, In the metadata section of the legal layout, combine the two page.data.description conditional renderings into a single conditional Fragment containing both the name="description" and property="og:description" meta tags. Preserve the existing output and condition while removing the duplicated check.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/legal-layout.tsx`:
- Around line 25-34: In the metadata section of the legal layout, combine the
two page.data.description conditional renderings into a single conditional
Fragment containing both the name="description" and property="og:description"
meta tags. Preserve the existing output and condition while removing the
duplicated check.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 5d1474c4-3f19-4a4b-ac7d-ceacf33f2472
📒 Files selected for processing (5)
press.config.tsxsrc/blog/layouts.tsxsrc/legal-layout.tsxsrc/pages/index.tsxsrc/pages/invite.tsx
Why
各頁面 head 缺件不一:docs 頁沒有 canonical 和
name=description;blog 文章宣告了twitter:card=summary_large_image卻沒有 og:image(takumi 其實有生每篇的 webp,只是沒被引用);首頁 og:image 用相對路徑,scraper 抓不到;/invite 的 canonical 沒有 trailing slash,跟 #319 定下的規則不一致。What
press.config.tsx:新增meta.page,為走 fumapress 預設 meta 的頁面(docs)補 canonical 與name=descriptionMeta:新增 og:image,文章頁指向 takumi 產出的/blog/<slug>.webp,index/tags 頁 fallback 到站圖canonicalUrl()(trailing slash)build 後逐一檢查過 index、invite、docs(含子頁)、blog 文章、privacy 的 head,canonical / og:image / description 都齊了。
Summary by CodeRabbit
新功能
改善
後續追加
(/docs/...)改成相對檔名(./xxx.mdx),交給createRelativeLink的resolveHref在 build 時解析成page.url— 之後開 i18n 連結會自動帶語言 prefix,也順帶修掉一條指到不存在頁面的(./jobs)