Skip to content

point canonical and sitemap urls at trailing-slash form - #319

Merged
kane50613 merged 1 commit into
masterfrom
fix/canonical-trailing-slash
Jul 21, 2026
Merged

point canonical and sitemap urls at trailing-slash form#319
kane50613 merged 1 commit into
masterfrom
fix/canonical-trailing-slash

Conversation

@kane50613

Copy link
Copy Markdown
Member

Why

Cloudflare Pages 對目錄型頁面一律 308 到帶斜線的網址(/docs/docs/),但站上的 canonical 跟 sitemap 全部寫成無斜線版本。實測正式站:

GET /blog/how-to-invite-bot        → 308 → /blog/how-to-invite-bot/
canonical: https://yeecord.com/blog/how-to-invite-bot   ← 指向一個會轉址的網址
sitemap:   <loc>https://yeecord.com/docs/commands</loc> ← 每條都要多跳一次

canonical 指向轉址目標會讓搜尋引擎多解析一層,也可能被當成訊號不一致。

What

  • config.ts 新增 canonicalUrl(path):補上結尾斜線再接網域
  • 三個 canonical 來源改用它:blog 的 Meta、legal 頁、首頁
  • sitemapPlugin 傳入 getEntryloc 一律帶斜線(正式站的 sitemap 本來就沒有 lastmod,行為無損)

建置驗證:blog/legal/首頁 canonical 與 sitemap 全部輸出帶斜線網址。

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying website with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5512f92
Status:⚡️  Build in progress...

View logs

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Warning

Review limit reached

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

Next review available in: 25 minutes

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: ea359fa0-2865-4ce7-a589-4a12a267bf5c

📥 Commits

Reviewing files that changed from the base of the PR and between e63b325 and 5512f92.

📒 Files selected for processing (5)
  • config.ts
  • press.config.tsx
  • src/blog/layouts.tsx
  • src/legal-layout.tsx
  • src/pages/index.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/canonical-trailing-slash

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.

@kane50613
kane50613 merged commit 12a25e4 into master Jul 21, 2026
0 of 2 checks passed
@kane50613
kane50613 deleted the fix/canonical-trailing-slash branch July 21, 2026 05:54
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