@@ -12,35 +12,35 @@ namespace Elastic.Documentation.Site.Navigation;
1212public class IsolatedBuildNavigationHtmlWriter ( BuildContext context , IRootNavigationItem < INavigationModel , INavigationItem > siteRoot )
1313 : INavigationHtmlWriter
1414{
15- private readonly ConcurrentDictionary < ( string , int ) , string > _renderedNavigationCache = [ ] ;
15+ private readonly ConcurrentDictionary < string , string > _renderedNavigationCache = [ ] ;
1616
1717 public async Task < NavigationRenderResult > RenderNavigation (
18- IRootNavigationItem < INavigationModel , INavigationItem > currentRootNavigation , INavigationItem currentNavigationItem , int maxLevel , Cancel ctx = default
18+ IRootNavigationItem < INavigationModel , INavigationItem > currentRootNavigation , INavigationItem currentNavigationItem , Cancel ctx = default
1919 )
2020 {
2121 var navigation = context . Configuration . Features . PrimaryNavEnabled || currentRootNavigation . IsUsingNavigationDropdown
2222 ? currentRootNavigation
2323 : siteRoot ;
24- var id = ShortId . Create ( $ "{ ( navigation . Id , maxLevel ) . GetHashCode ( ) } ") ;
25- if ( _renderedNavigationCache . TryGetValue ( ( navigation . Id , maxLevel ) , out var value ) )
24+ var id = ShortId . Create ( $ "{ navigation . Id . GetHashCode ( ) } ") ;
25+ if ( _renderedNavigationCache . TryGetValue ( navigation . Id , out var value ) )
2626 {
2727 return new NavigationRenderResult
2828 {
2929 Html = value ,
3030 Id = id
3131 } ;
3232 }
33- var model = CreateNavigationModel ( navigation , maxLevel ) ;
33+ var model = CreateNavigationModel ( navigation ) ;
3434 value = await ( ( INavigationHtmlWriter ) this ) . Render ( model , ctx ) ;
35- _renderedNavigationCache [ ( navigation . Id , maxLevel ) ] = value ;
35+ _renderedNavigationCache [ navigation . Id ] = value ;
3636 return new NavigationRenderResult
3737 {
3838 Html = value ,
3939 Id = id
4040 } ;
4141 }
4242
43- private NavigationViewModel CreateNavigationModel ( IRootNavigationItem < INavigationModel , INavigationItem > navigation , int maxLevel ) =>
43+ private NavigationViewModel CreateNavigationModel ( IRootNavigationItem < INavigationModel , INavigationItem > navigation ) =>
4444 new ( )
4545 {
4646 Title = navigation . NavigationTitle ,
@@ -49,7 +49,6 @@ private NavigationViewModel CreateNavigationModel(IRootNavigationItem<INavigatio
4949 IsPrimaryNavEnabled = context . Configuration . Features . PrimaryNavEnabled ,
5050 IsUsingNavigationDropdown = context . Configuration . Features . PrimaryNavEnabled || navigation . IsUsingNavigationDropdown ,
5151 IsGlobalAssemblyBuild = false ,
52- TopLevelItems = siteRoot . NavigationItems . OfType < INodeNavigationItem < INavigationModel , INavigationItem > > ( ) . ToList ( ) ,
53- MaxLevel = maxLevel
52+ TopLevelItems = siteRoot . NavigationItems . OfType < INodeNavigationItem < INavigationModel , INavigationItem > > ( ) . ToList ( )
5453 } ;
5554}
0 commit comments