Skip to content

API Explorer: derive canonical and robots from the API page type - #4976

Merged
reakaleek merged 3 commits into
mainfrom
api-page-type-canonical-7e03553b
Nov 20, 2026
Merged

reakaleek merged 3 commits into
mainfrom
api-page-type-canonical-7e03553b

Conversation

@reakaleek

Copy link
Copy Markdown
Member

Why

  • Every API page names itself as canonical, and _Head.cshtml prints one global robots value. The numbered copy of the newest major and the unreleased /next tree both claim to be the indexable page.
  • The RFC sets a canonical and robots value for each page type. This change makes one function decide them.

Closes elastic/docs-eng-team#1217

What

  • API pages get canonical and robots from their page type: versionless, numbered copy of the newest major, older major, or unreleased.
  • The numbered copy of the newest major names the versionless page as canonical. The unreleased tree renders noindex. A build that disallows indexing still renders noindex, nofollow on every page.
  • Each tree carries its page type, and the page type exposes sitemap eligibility for elastic/docs-eng-team#1219.
  • Markdown and Codex pages render the same <head> as before.

Notes

  • The end-of-life page type is not in this PR. It needs the end-of-life source from D3. Tracked in elastic/docs-eng-team#1229.
  • Only prod sets allow_indexing: true. On staging and edge, every API page keeps noindex, nofollow, so the canonical change shows there and the robots values show on prod. Fixture-build tests cover both.

🤖 Generated with Claude Code

One function maps each rendered API tree to a page type. The numbered copy of the newest major names the versionless page as canonical. The unreleased tree renders noindex. A build that disallows indexing still wins on every page. Markdown pages keep their head.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@reakaleek
reakaleek requested a review from a team as a code owner November 20, 2026 01:49
@reakaleek
reakaleek requested a review from theletterf November 20, 2026 01:49
reakaleek and others added 2 commits November 20, 2026 02:52
…w by @infra-vault-gh-plugin-prod)

The fixture keeps the canonical base in the non-indexable case, so the v9 copy is checked for the staging and edge combination.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…per review by @infra-vault-gh-plugin-prod)

The fixture build reads the exported .md of the v9 and versionless pages and checks that both name the versionless page.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

@reakaleek
reakaleek merged commit 606b60d into main Nov 20, 2026
44 checks passed
@reakaleek
reakaleek deleted the api-page-type-canonical-7e03553b branch November 20, 2026 02:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant