@@ -44,18 +44,19 @@ public string Render(string markdown, IFileInfo? source)
4444 return MarkdownFile . CreateHtml ( parsed ) ;
4545 }
4646
47- public async Task < string > RenderLayout ( MarkdownFile markdown , Cancel ctx = default )
47+ public async Task < ( string , string ) > RenderLayout ( MarkdownFile markdown , Cancel ctx = default )
4848 {
4949 var document = await markdown . ParseFullAsync ( ctx ) ;
5050 return await RenderLayout ( markdown , document , ctx ) ;
5151 }
5252
53- private async Task < string > RenderLayout ( MarkdownFile markdown , MarkdownDocument document , Cancel ctx = default )
53+ private async Task < ( string , string ) > RenderLayout ( MarkdownFile markdown , MarkdownDocument document , Cancel ctx = default )
5454 {
5555 var html = MarkdownFile . CreateHtml ( document ) ;
5656 await DocumentationSet . Tree . Resolve ( ctx ) ;
5757
58- var navigationHtml = await NavigationHtmlWriter . RenderNavigation ( markdown . NavigationRoot , markdown . NavigationSource , ctx ) ;
58+ var fullNavigationHtml = await NavigationHtmlWriter . RenderNavigation ( markdown . NavigationRoot , markdown . NavigationSource , - 1 , ctx ) ;
59+ var miniNavigationHtml = await NavigationHtmlWriter . RenderNavigation ( markdown . NavigationRoot , markdown . NavigationSource , 1 , ctx ) ;
5960
6061 var current = PositionalNavigation . GetCurrent ( markdown ) ;
6162 var previous = PositionalNavigation . GetPrevious ( markdown ) ;
@@ -115,7 +116,7 @@ private async Task<string> RenderLayout(MarkdownFile markdown, MarkdownDocument
115116 PreviousDocument = previous ,
116117 NextDocument = next ,
117118 Parents = parents ,
118- NavigationHtml = navigationHtml ,
119+ NavigationHtml = miniNavigationHtml ,
119120 UrlPathPrefix = markdown . UrlPathPrefix ,
120121 AppliesTo = markdown . YamlFrontMatter ? . AppliesTo ,
121122 GithubEditUrl = editUrl ,
@@ -132,7 +133,7 @@ private async Task<string> RenderLayout(MarkdownFile markdown, MarkdownDocument
132133 Products = allProducts ,
133134 VersionsConfig = DocumentationSet . Context . VersionsConfig
134135 } ) ;
135- return await slice . RenderAsync ( cancellationToken : ctx ) ;
136+ return ( fullNavigationHtml , await slice . RenderAsync ( cancellationToken : ctx ) ) ;
136137 }
137138
138139 public async Task < MarkdownDocument > WriteAsync ( IFileInfo outputFile , MarkdownFile markdown , IConversionCollector ? collector , Cancel ctx = default )
@@ -160,8 +161,9 @@ public async Task<MarkdownDocument> WriteAsync(IFileInfo outputFile, MarkdownFil
160161 var document = await markdown . ParseFullAsync ( ctx ) ;
161162
162163 var rendered = await RenderLayout ( markdown , document , ctx ) ;
163- collector ? . Collect ( markdown , document , rendered ) ;
164- await writeFileSystem . File . WriteAllTextAsync ( path , rendered , ctx ) ;
164+ collector ? . Collect ( markdown , document , rendered . Item2 ) ;
165+ await writeFileSystem . File . WriteAllTextAsync ( path , rendered . Item2 , ctx ) ;
166+ await writeFileSystem . File . WriteAllTextAsync ( path . Replace ( ".html" , ".nav.html" ) , rendered . Item1 , ctx ) ;
165167 return document ;
166168 }
167169
0 commit comments