Repository navigation
Drop the trailing slash from API children: page URLs - #4992
Merged
Merged
Conversation
`ApiUrlBuilder.ChildUrl` was the only API URL builder that ended in `/`. The sitemap listed `/docs/api/kibana/spaces/`, and docs-edge redirects that URL to the bare path. Co-Authored-By: Claude Opus 5.5 <[email protected]>
akira28
approved these changes
Nov 20, 2026
| /// <summary>URL of a <c>children:</c> page, from its file slug.</summary> | ||
| public static string ChildUrl(string? urlPathPrefix, string apiUrlSuffix, string slug) => | ||
| $"{ProductRoot(urlPathPrefix, apiUrlSuffix)}/{slug}/"; | ||
| $"{ProductRoot(urlPathPrefix, apiUrlSuffix)}/{slug}"; |
There was a problem hiding this comment.
Severity: P3 (Low)
Carry forward the existing content date when switching to the slashless URL. The index looks up content_last_updated by exact URL, so the first reindex stamps unchanged Spaces pages with the deploy date. The sitemap then publishes that date as <lastmod>, and subsequent syncs keep it even though the page content did not change.
Generated by Libra. React with 👍 or 👎 to give feedback on this comment.
reakaleek
enabled auto-merge (squash)
November 20, 2026 14:27
Contributor
Docs preview (local build)Handbook preview: https://docs-v3-preview.elastic.dev/elastic/docs-builder/pull/4992/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
API pages listed under
children:now get URLs without a trailing slash. The sitemap stops listing/docs/api/kibana/spaces/and/docs/api/kibana/v8/spaces/, which docs-edge redirects to the bare path.Affects: API reference, Search
Prompt summary:
kibana/spaces/andkibana/v8/spaces/are the only URLs on the site with a trailing slash. docs-edge redirects them to the bare path, so the sitemap lists a URL that redirects. The ask is to make the sitemap list the URL that serves the page.Why
ApiUrlBuilder.ChildUrlbuilds the URL of everychildren:page in an API docset, and it ends that URL in/. The other API URL builders do not. Kibana'sspacespage is the onlychildren:page in production. The sidebar link, the search index entry andsitemap-api.xmlall take its URL fromChildUrl, and docs-edge answers that URL with a301.What
The URL of a
children:pageThe URL now ends at the page slug, the same as the authentication, servers and topic pages. The built files stay the same, because the output path already strips a trailing slash before it adds
/index.html. Canonical URLs, breadcrumbs and the version switcher already compare URLs without the slash, so they do not change.Tests
A new test pins
ChildUrlwithout a trailing slash, for a versionless and a versioned API. Four existing tests expected the slash and now expect the bare URL. With the slash put back, six tests fail.Out of scope: the docs-infra redirects from Bump.sh topics to child pages still point at the URL with the slash. They keep working through the edge
301.Risk: the search index keys a document by its URL. The next incremental index writes the page under the bare URL. The stale entry with the slash should drop out through the normal cleanup of stale documents. Check this on edge after the deploy.
Verify
After the deploy, this prints nothing:
🤖 Generated with Claude Code