Skip to content

πŸ› Normalize series canonical URLs - #575

Merged
baealex merged 1 commit into
mainfrom
fix/normalize-series-canonical-urls
Sep 14, 2026
Merged

baealex merged 1 commit into
mainfrom
fix/normalize-series-canonical-urls

Conversation

@baealex

@baealex baealex commented Sep 14, 2026 •

Copy link
Copy Markdown
Owner

🎯 Goal

  • Align BLEX canonical metadata with the clean series URLs Google selected for the two Search Console mismatches on first-page ?sort=asc variants.
  • Reduce duplicate default query variants without collapsing distinct paginated content into the series root.

πŸ”§ Core Changes

  • Emit the clean series root as canonical for ascending and descending first-page views.
  • Preserve self-canonical URLs for later pages: ascending page N uses ?sort=asc&page=N, while descending page N uses ?page=N.
  • Stop generating page=1 in pagination links.
  • Link the default newest-first control directly to the clean request path instead of ?sort=desc.
  • Add regression coverage for canonical metadata and pagination-link normalization.

πŸ€” Key Decisions

  • Normalize only first-page sorting variants because the observed Search Console mismatch was ?sort=asc on page 1.
  • Keep page 2 and later self-canonical because those URLs represent different page content and must not be folded into the series root.
  • Preserve sort=asc on later pages so their canonical URL continues to describe the rendered ordering.
  • Normalize default internal links as well as metadata to reduce rediscovery of redundant page=1 and sort=desc URLs.

πŸ§ͺ Verification Guide

How to verify

  1. Run ./scripts/manage.sh test board.tests.templates.test_series_static_seo board.tests.test_pagination_tags -v 2.
  2. Run ./scripts/manage.sh test board.tests.api.test_series_api board.tests.templates.test_series_static_seo board.tests.test_pagination_tags -v 1.
  3. Open a series first page with ?sort=asc and confirm its canonical points to the clean series path.
  4. Open ascending and descending page 2 views and confirm each retains the expected self-canonical query.

Expected result

  • All 20 focused SEO and pagination tests pass.
  • All 62 related series API, SEO, and pagination tests pass.
  • Django system checks report no issues.
  • Ascending and descending page 1 canonicalize to the clean series root.
  • Ascending page 2 canonicalizes to ?sort=asc&page=2; descending page 2 canonicalizes to ?page=2.
  • Pagination links omit page=1, and the newest-first control uses the clean path.

βœ… Checklist

  • Tests completed
  • Django system checks completed
  • Canonical regression coverage added
  • Documentation updated (not needed: behavior is covered by tests and PR rationale)

@baealex baealex changed the title fix(seo): normalize series canonical URLs πŸ› Normalize series canonical URLs Sep 14, 2026
@baealex
baealex merged commit cf8d886 into main Sep 14, 2026
3 checks passed
@baealex
baealex deleted the fix/normalize-series-canonical-urls branch September 14, 2026 14:09
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