diff --git a/src/Elastic.ApiExplorer/OpenApiGenerator.cs b/src/Elastic.ApiExplorer/OpenApiGenerator.cs index 75e9129bc..66dab39cc 100644 --- a/src/Elastic.ApiExplorer/OpenApiGenerator.cs +++ b/src/Elastic.ApiExplorer/OpenApiGenerator.cs @@ -288,7 +288,7 @@ private async Task Render(INavigationItem current, T page, ApiRend if (!outputFile.Directory!.Exists) outputFile.Directory.Create(); - var navigationHtml = await navigationRenderer.RenderNavigation(current.NavigationRoot, new Uri("http://ignored.example"), ctx); + var navigationHtml = await navigationRenderer.RenderNavigation(current.NavigationRoot, new Uri("http://ignored.example"), INavigationHtmlWriter.AllLevels, ctx); renderContext = renderContext with { CurrentNavigation = current, diff --git a/src/Elastic.Documentation.Configuration/Builder/FeatureFlags.cs b/src/Elastic.Documentation.Configuration/Builder/FeatureFlags.cs index 6d54f808b..1ae0ddbc3 100644 --- a/src/Elastic.Documentation.Configuration/Builder/FeatureFlags.cs +++ b/src/Elastic.Documentation.Configuration/Builder/FeatureFlags.cs @@ -20,6 +20,12 @@ public bool PrimaryNavEnabled set => _featureFlags["primary-nav"] = value; } + public bool LazyLoadNavigation + { + get => IsEnabled("LAZY_LOAD_NAVIGATION"); + set => _featureFlags["LAZY_LOAD_NAVIGATION"] = value; + } + private bool IsEnabled(string key) { var envKey = $"FEATURE_{key.ToUpperInvariant().Replace('-', '_')}"; diff --git a/src/Elastic.Documentation.Site/Layout/_PagesNav.cshtml b/src/Elastic.Documentation.Site/Layout/_PagesNav.cshtml index 8b95f7e69..baec6f8de 100644 --- a/src/Elastic.Documentation.Site/Layout/_PagesNav.cshtml +++ b/src/Elastic.Documentation.Site/Layout/_PagesNav.cshtml @@ -1,5 +1,10 @@ @inherits RazorSlice