Sitemap lists hundreds of URLs that declare a different canonical

Đang mở Phù hợp với người mới
#2,568 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@NopeCharon đang làm issue này rồi.

Từ ngày 6/11/2026.

  • #2569 của @NopeCharon — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
83/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
javascript, node.js
Lĩnh vực
documentation

Hướng nghiên cứu

Bắt đầu với bộ lọc sitemap trong astro.config.mjs và xem lại các khai báo URL canonical được thêm trong #2432 cùng với thay đổi bộ lọc trong #2430. So sánh các mục sitemap được tạo với URL canonical của từng trang để tìm hiểu vì sao 635 mục khác nhau. Công việc hoàn tất khi sitemap chỉ chứa các trang có URL được liệt kê là URL canonical của chính trang đó.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Environment information

Version: main at 854213b2 and the live site, https://expressjs.com

Platform: not relevant, this is generated build output

Node.js version: not relevant

Any other relevant information: the filter in astro.config.mjs says "Only the canonical URLs belong in the sitemap", and it was tightened with that goal in #2430. The canonical URLs themselves were declared in #2432, but the sitemap filter doesn't take them into account.

What steps will reproduce the bug?

  1. Open https://expressjs.com/sitemap-0.xml.
  2. Compare each <loc> with the rel="canonical" of that page.

Of the 1,311 URLs listed, 635 declare a different page as canonical:

Listed in the sitemap Canonical
/en/ /
/en/guide/routing/, /es/guide/routing/ /en/5x/guide/routing/, /es/5x/guide/routing/
/en/api/express/ /en/5x/api/express/
/es/5x/api/express/ /en/5x/api/express/
/es/blog/2024-10-15-v5-release/ /en/blog/2024-10-15-v5-release/

Sending search engines conflicting signals like this can make them ignore the sitemap's hints and spend crawl budget on duplicates.

Expected: the sitemap lists only pages that are their own canonical URL.

Ngôn ngữ chính
MDX
Star
5.4k
Fork
2.3k
Merge trung bình
2 ngày 23 giờ
Pull request đã merge (30 ngày)
28

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của expressjs/expressjs.com

Tất cả issue của expressjs/expressjs.com

Issue tương tự

Thêm issue về Documentation

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.