TanStack / TanStack/tanstack.com

fix(seo): make the sitemap canonical-only, healthy, and testable

Aperta
#1,153 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

bug
Lingua principale
TypeScript
Stelle
1.1k
Fork
401
Merge medio
18h 14m
PR unite (30g)
56

Descrizione

Problem

The production sitemap currently contains 3,245 URLs. A live audit found several categories of non-canonical or unhealthy entries:

  • 189 Charts catalog URLs use trailing slashes and immediately redirect to the no-trailing-slash canonical.
  • /showcase redirects to a default query-string URL before canonicalizing back to /showcase.
  • Four /drafts/ URLs and two README URLs are included.
  • Draft and README examples currently return 200 pages headed Content temporarily unavailable.
  • A stratified check of 160 sitemap entries found 23 redirects and one 404, including stale DB reference paths that redirect to a parent reference page or no longer resolve.
  • Only 77 entries currently contain lastmod values; docs and most other content do not.
  • Approved showcase detail pages are not included even though later showcase pagination is currently noindex/nofollow.

Google says sitemap entries should be the canonical URLs the site wants indexed: https://developers.google.com/search/docs/crawling-indexing/sitemaps/build-sitemap

Relevant generation code: src/utils/sitemap.ts

Required changes

  • Emit only URLs that return 200, are indexable, and self-canonicalize.
  • Normalize Charts catalog entries to the production no-trailing-slash form.
  • Exclude drafts, *.draft paths, README files, temporary-unavailable placeholders, hidden libraries, and other non-public docs artifacts.
  • Apply docs redirect resolution before adding manifest paths to the sitemap.
  • Remove stale or missing generated-reference paths.
  • Reconcile /showcase so the sitemap entry does not require an avoidable redirect.
  • Add approved showcase detail pages if they are intended for organic discovery.
  • Keep query-string URLs only when they represent an intentionally indexable canonical page, such as the previous-partners directory.
  • Add accurate lastmod values where the source provides a real meaningful modification date; do not synthesize timestamps on every request.

Automated validation

Add a sitemap contract checker that can validate generated entries and optionally check a deployed base URL.

For every sitemap URL, verify:

  • Final status is 200 without following a redirect.
  • Exactly one canonical link exists.
  • Canonical equals the sitemap URL after consistent URL normalization.
  • No robots noindex directive is present.
  • The page is not a temporary-unavailable or error placeholder.
  • The URL has no disallowed draft, README, embed, account, or admin pattern.

Acceptance criteria

  • Production sitemap contains zero redirecting URLs.
  • Production sitemap contains zero 4xx or 5xx URLs.
  • Production sitemap contains zero noindex URLs.
  • Every entry is self-canonical.
  • Drafts and repository-maintenance documents are absent.
  • Charts catalog URLs use the same trailing-slash policy as their canonical pages.
  • Unit tests cover path filtering and canonical normalization.
  • A CI or release-time check prevents regressions in the sitemap contract.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia da src/utils/sitemap.ts e verifica come i percorsi del manifest, i reindirizzamenti, le pagine showcase e i valori lastmod entrano nella sitemap generata. Aggiungi la validazione richiesta del contratto della sitemap e la copertura con unit test per il filtraggio dei percorsi e la normalizzazione canonica; il lavoro è completato quando le voci di produzione sono URL 200, indicizzabili, autocanoniche, senza segnaposto né artefatti non consentiti.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
typescript
Ambito
documentation, testing, web-dev
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
58/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.