Skip to content

add missing canonical and og:image meta across pages - #320

Merged
kane50613 merged 4 commits into
masterfrom
fix/seo-meta
Jul 21, 2026
Merged

add missing canonical and og:image meta across pages#320
kane50613 merged 4 commits into
masterfrom
fix/seo-meta

Conversation

@kane50613

@kane50613 kane50613 commented Jul 21, 2026

Copy link
Copy Markdown
Member

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=description
  • blog Meta:新增 og:image,文章頁指向 takumi 產出的 /blog/<slug>.webp,index/tags 頁 fallback 到站圖
  • legal 頁:補 og:title、og:description、og:image
  • 首頁、/invite:og:image 改絕對網址;/invite canonical 改走 canonicalUrl()(trailing slash)

build 後逐一檢查過 index、invite、docs(含子頁)、blog 文章、privacy 的 head,canonical / og:image / description 都齊了。

Summary by CodeRabbit

  • 新功能

    • 新增各頁面的 canonical 連結,協助搜尋引擎辨識正式網址。
    • 補強頁面描述與 Open Graph 中繼資料,提升社群分享預覽品質。
    • 部落格頁面支援使用專屬分享圖片,未設定時維持預設圖片。
    • 邀請頁新增 canonical 連結與 Open Graph 圖片資訊。
  • 改善

    • 統一法律頁、首頁與部落格頁面的標題、描述及分享圖片設定。

後續追加

  • legal 頁 title 改成「頁名 - Yeecord」順序
  • docs 內部連結從絕對路徑 (/docs/...) 改成相對檔名 (./xxx.mdx),交給 createRelativeLinkresolveHref 在 build 時解析成 page.url — 之後開 i18n 連結會自動帶語言 prefix,也順帶修掉一條指到不存在頁面的 (./jobs)

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@kane50613, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 1 minute

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 10e50669-bb75-4df9-9909-0a9378d9d9bb

📥 Commits

Reviewing files that changed from the base of the PR and between 76d8159 and ce67aeb.

📒 Files selected for processing (5)
  • content/docs/commands/list.mdx
  • content/docs/index.mdx
  • content/docs/rpg/introduction.mdx
  • content/docs/rpg/shop.mdx
  • src/legal-layout.tsx
📝 Walkthrough

Walkthrough

此變更統一頁面 canonical 與 description metadata,並更新部落格、首頁、法律頁及邀請頁的 Open Graph 圖片、標題與描述輸出。

Changes

SEO metadata

Layer / File(s) Summary
頁面層級 metadata
press.config.tsx
新增頁面 canonical link,並在存在 description 時輸出 description meta。
部落格 Open Graph 圖片
src/blog/layouts.tsx
Meta 支援自訂圖片;BlogPage 依頁面 URL 產生 WebP 圖片,未提供時回退至預設 Open Graph 圖片。
固定頁面 metadata
src/legal-layout.tsx, src/pages/index.tsx, src/pages/invite.tsx
更新法律頁標題與 OG metadata,並為首頁及邀請頁使用絕對圖片 URL;邀請頁新增 canonical link。

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • yeecord/website#316:直接重疊於相同的 canonical、description 與 Open Graph metadata 實作。
  • yeecord/website#317:同樣更新 press.config.tsx 的頁面層級 canonical 與 description metadata。
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 標題準確概括了這次主要是在多個頁面補上 canonical 與 og:image 等 SEO meta。
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/seo-meta

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 21, 2026

Copy link
Copy Markdown

Deploying website with  Cloudflare Pages  Cloudflare Pages

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

View logs

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 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

📥 Commits

Reviewing files that changed from the base of the PR and between daddd0d and 76d8159.

📒 Files selected for processing (5)
  • press.config.tsx
  • src/blog/layouts.tsx
  • src/legal-layout.tsx
  • src/pages/index.tsx
  • src/pages/invite.tsx

@kane50613
kane50613 merged commit ad06787 into master Jul 21, 2026
1 of 2 checks passed
@kane50613
kane50613 deleted the fix/seo-meta branch July 21, 2026 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant