diff --git a/docs/data/openapi/api-explorer.md b/docs/data/openapi/api-explorer.md index 0f6d7154a4..0c5617db63 100644 --- a/docs/data/openapi/api-explorer.md +++ b/docs/data/openapi/api-explorer.md @@ -151,6 +151,8 @@ specs per product are not currently supported. Product pages show an API product switcher in the left navigation. The list includes every declared API and a Back to hub option. +Assembler API pages also show a Jump to API box at the top of that sidebar. The box searches API operations only. Isolated and air-gapped builds omit the box. Markdown docs pages do not get it back. + ## Remote spec resolution When `spec:` does not resolve to a file on disk, {{dbuild}} resolves the current (`main`) version diff --git a/src/Elastic.ApiExplorer/Infrastructure/ApiViewModel.cs b/src/Elastic.ApiExplorer/Infrastructure/ApiViewModel.cs index 6ce5455f1a..c55959ed50 100644 --- a/src/Elastic.ApiExplorer/Infrastructure/ApiViewModel.cs +++ b/src/Elastic.ApiExplorer/Infrastructure/ApiViewModel.cs @@ -28,6 +28,10 @@ public record ApiLayoutViewModel : GlobalLayoutViewModel public required ApiBreadcrumbTrail Breadcrumbs { get; init; } public IReadOnlyList VersionSwitcherItems { get; init; } = []; public IReadOnlyList HubSwitcherItems { get; init; } = []; + + /// Assembler builds host Jump to API unless the site is air-gapped. + public bool ShowJumpToPage => BuildType == BuildType.Assembler && !Features.AirGappedEnabled; + public required string MarkdownUrl { get; init; } /// diff --git a/src/Elastic.ApiExplorer/_Partials/Layout/_ApiPagesNav.cshtml b/src/Elastic.ApiExplorer/_Partials/Layout/_ApiPagesNav.cshtml index 430c6a9917..f84ad301c6 100644 --- a/src/Elastic.ApiExplorer/_Partials/Layout/_ApiPagesNav.cshtml +++ b/src/Elastic.ApiExplorer/_Partials/Layout/_ApiPagesNav.cshtml @@ -4,26 +4,33 @@ id="pages-nav" @(Model.Features.NavigationPreviewEnabled ? "hx-preserve" : "") class="sidebar-nav h-full simple-scrollbar"> - @if (Model.HubSwitcherItems.Count > 0) + @if (Model.ShowJumpToPage || Model.HubSwitcherItems.Count > 0) {
- - + @foreach (var item in Model.HubSwitcherItems) { - + if (item.Selected) + { + + } + else + { + + } } - else - { - - } - } - + + }
}