Add a product switcher on API reference pages - #4035
Open
reakaleek wants to merge 2 commits into
Open
Conversation
API pages cannot jump to another product or the hub because they do not use the site navigation dropdown. Co-Authored-By: Cursor Grok 4.6 <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Docs preview (local build)Handbook preview: https://docs-v3-preview.elastic.dev/elastic/docs-builder/pull/4035/ Sample changed pages: |
Member
Author
|
We might want to move it elsewhere in a follow-up. |
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 product pages now show a sidebar switcher. A reader can open another declared API or return to the hub without the browser back button.
Affects: API reference, Assembler builds
Prompt summary: Add a hub product switcher on API product pages so a reader can jump between assembled APIs and back to the hub. The tracking issue is elastic/docs-eng-team#817.
Why
API product pages do not use the site navigation dropdown. A reader on an Elasticsearch operation page cannot open Kibana or
/docs/api/without the browser back button.Closes elastic/docs-eng-team#817
What
Sidebar product switcher
The left navigation on a product page shows a dropdown above the version list. The first option is Back to hub. The remaining options are the declared APIs, ordered by title. The current product is selected. The hub page hides the control.
Catalog collected before render
The generator reads declared
api:entries before it fetches any spec. The assembler unions every owner's list and the first key wins. Each product render receives that shared list.Isolated generate
A single-repo generate still builds the switcher from that repo's
api:config. Sibling APIs appear only when the caller passes a shared list.Verify
On a local serve of this repo, open
/api/doc/docs-builder-elasticsearch/and confirm the switcher lists Back to hub plus that product. An assembler preview is required to confirm a jump from Elasticsearch to Kibana.Out of scope — The switcher does not sit in the header or secondary nav. Production still proxies API pages to bump.sh until the explorer ships there.
Made with Cursor