diff --git a/src/Elastic.ApiExplorer/Endpoints/ApiEndpoint.cs b/src/Elastic.ApiExplorer/Endpoints/ApiEndpoint.cs index 356e7651c..2c72f93d4 100644 --- a/src/Elastic.ApiExplorer/Endpoints/ApiEndpoint.cs +++ b/src/Elastic.ApiExplorer/Endpoints/ApiEndpoint.cs @@ -58,10 +58,13 @@ public EndpointNavigationItem(int depth, string url, ApiEndpoint apiEndpoint, La public ApiEndpoint Index { get; } public string Url { get; } public string NavigationTitle { get; } + public bool Hidden => false; public IReadOnlyCollection NavigationItems { get; set; } = []; public INodeNavigationItem NavigationRoot { get; } public INodeNavigationItem? Parent { get; set; } + + public int NavigationIndex { get; set; } } diff --git a/src/Elastic.ApiExplorer/Endpoints/EndpointView.cshtml b/src/Elastic.ApiExplorer/Endpoints/EndpointView.cshtml index 023545495..95bc519ec 100644 --- a/src/Elastic.ApiExplorer/Endpoints/EndpointView.cshtml +++ b/src/Elastic.ApiExplorer/Endpoints/EndpointView.cshtml @@ -7,24 +7,15 @@ { DocSetName = "Api Explorer", Description = "", - Layout = null, - PageTocItems = [], CurrentNavigationItem = Model.CurrentNavigationItem, Previous = null, Next = null, NavigationHtml = Model.NavigationHtml, - LegacyPage = null, UrlPathPrefix = null, - GithubEditUrl = null, - ReportIssueUrl = null, AllowIndexing = false, CanonicalBaseUrl = null, GoogleTagManager = new GoogleTagManagerConfiguration(), Features = new FeatureFlags([]), - Parents = - [ - ], - Products = null, StaticFileContentHashProvider = Model.StaticFileContentHashProvider }; } diff --git a/src/Elastic.ApiExplorer/Landing/LandingNavigationItem.cs b/src/Elastic.ApiExplorer/Landing/LandingNavigationItem.cs index 6a1f798a9..f472b58eb 100644 --- a/src/Elastic.ApiExplorer/Landing/LandingNavigationItem.cs +++ b/src/Elastic.ApiExplorer/Landing/LandingNavigationItem.cs @@ -34,8 +34,10 @@ public class LandingNavigationItem : INodeNavigationItem? Parent { get; set; } + public int NavigationIndex { get; set; } public IReadOnlyCollection NavigationItems { get; set; } = []; public string Url { get; } + public bool Hidden => false; //TODO public string NavigationTitle { get; } = "API Documentation"; diff --git a/src/Elastic.ApiExplorer/Landing/LandingView.cshtml b/src/Elastic.ApiExplorer/Landing/LandingView.cshtml index ac0db7b18..d24553791 100644 --- a/src/Elastic.ApiExplorer/Landing/LandingView.cshtml +++ b/src/Elastic.ApiExplorer/Landing/LandingView.cshtml @@ -7,24 +7,15 @@ { DocSetName = "Api Explorer", Description = "", - Layout = null, - PageTocItems = [], CurrentNavigationItem = Model.CurrentNavigationItem, Previous = null, Next = null, NavigationHtml = Model.NavigationHtml, - LegacyPage = null, UrlPathPrefix = null, - GithubEditUrl = null, - ReportIssueUrl = null, AllowIndexing = false, CanonicalBaseUrl = null, GoogleTagManager = new GoogleTagManagerConfiguration(), Features = new FeatureFlags([]), - Parents = - [ - ], - Products = null, StaticFileContentHashProvider = Model.StaticFileContentHashProvider }; } diff --git a/src/Elastic.ApiExplorer/Operations/OperationNavigationItem.cs b/src/Elastic.ApiExplorer/Operations/OperationNavigationItem.cs index 81c040654..fe021ca1e 100644 --- a/src/Elastic.ApiExplorer/Operations/OperationNavigationItem.cs +++ b/src/Elastic.ApiExplorer/Operations/OperationNavigationItem.cs @@ -47,8 +47,12 @@ public OperationNavigationItem(int depth, string url, ApiOperation apiOperation, public int Depth { get; } public ApiOperation Model { get; } public string Url { get; } + public bool Hidden => false; public string NavigationTitle { get; } public INodeNavigationItem? Parent { get; set; } + + public int NavigationIndex { get; set; } + } diff --git a/src/Elastic.ApiExplorer/Operations/OperationView.cshtml b/src/Elastic.ApiExplorer/Operations/OperationView.cshtml index 8404f7fbe..12d821176 100644 --- a/src/Elastic.ApiExplorer/Operations/OperationView.cshtml +++ b/src/Elastic.ApiExplorer/Operations/OperationView.cshtml @@ -7,24 +7,15 @@ { DocSetName = "Api Explorer", Description = "", - Layout = null, - PageTocItems = [], CurrentNavigationItem = Model.CurrentNavigationItem, Previous = null, Next = null, NavigationHtml = Model.NavigationHtml, - LegacyPage = null, UrlPathPrefix = null, - GithubEditUrl = null, - ReportIssueUrl = null, AllowIndexing = false, CanonicalBaseUrl = null, GoogleTagManager = new GoogleTagManagerConfiguration(), Features = new FeatureFlags([]), - Parents = - [ - ], - Products = null, StaticFileContentHashProvider = Model.StaticFileContentHashProvider }; } diff --git a/src/Elastic.Documentation.Configuration/TableOfContents/ITocItem.cs b/src/Elastic.Documentation.Configuration/TableOfContents/ITocItem.cs index 4046135ad..a5f745150 100644 --- a/src/Elastic.Documentation.Configuration/TableOfContents/ITocItem.cs +++ b/src/Elastic.Documentation.Configuration/TableOfContents/ITocItem.cs @@ -22,4 +22,20 @@ public record TocReference(Uri Source, ITableOfContentsScope TableOfContentsScop { public IReadOnlyDictionary TocReferences { get; } = Children.OfType().ToDictionary(kv => kv.Source, kv => kv); + + /// + /// A phantom table of contents is a table of contents that is not rendered in the UI but is used to generate the TOC. + /// This should be used sparingly and needs explicit configuration in navigation.yml. + /// It's typically used for container TOC that holds various other TOC's where its children are rehomed throughout the navigation. + /// Examples of phantom toc's: + /// + /// - toc: elasticsearch://reference + /// - toc: docs-content:// + /// + /// Because navigation.yml does exhaustive checks to ensure all toc.yml files are referenced, marking these containers as phantoms + /// ensures that these skip validation checks + /// + /// + public bool IsPhantom { get; init; } } + diff --git a/src/Elastic.Documentation.Site/Layout/_Head.cshtml b/src/Elastic.Documentation.Site/Layout/_Head.cshtml index 0080c521e..ef3904a60 100644 --- a/src/Elastic.Documentation.Site/Layout/_Head.cshtml +++ b/src/Elastic.Documentation.Site/Layout/_Head.cshtml @@ -1,6 +1,5 @@ @inherits RazorSlice @using FontPreloader = Elastic.Documentation.Site.FileProviders.FontPreloader - @Model.Title @@ -35,9 +34,3 @@ { } - @if (!string.IsNullOrEmpty(Model.Products)) - { - - - } - diff --git a/src/Elastic.Documentation.Site/Layout/_SecondaryNav.cshtml b/src/Elastic.Documentation.Site/Layout/_SecondaryNav.cshtml index 60436170d..49ba93c0b 100644 --- a/src/Elastic.Documentation.Site/Layout/_SecondaryNav.cshtml +++ b/src/Elastic.Documentation.Site/Layout/_SecondaryNav.cshtml @@ -2,7 +2,7 @@