File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
tests/Elastic.Markdown.Tests/DocSet Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -94,8 +94,18 @@ ICrossLinkResolver linkResolver
9494 NavigationIndexedByOrder = navigationFlatList
9595 . ToDictionary ( n => n . NavigationIndex , n => n )
9696 . ToFrozenDictionary ( ) ;
97- NavigationIndexedByCrossLink = navigationFlatList
98- . OfType < ILeafNavigationItem < MarkdownFile > > ( )
97+
98+ // Build cross-link dictionary including both:
99+ // 1. Direct leaf items (files without children)
100+ // 2. Index property of node items (files with children)
101+ var leafItems = navigationFlatList . OfType < ILeafNavigationItem < MarkdownFile > > ( ) ;
102+ var nodeIndexes = navigationFlatList
103+ . OfType < INodeNavigationItem < MarkdownFile , INavigationItem > > ( )
104+ . Select ( node => node . Index ) ;
105+
106+ NavigationIndexedByCrossLink = leafItems
107+ . Concat ( nodeIndexes )
108+ . DistinctBy ( n => n . Model . CrossLink )
99109 . ToDictionary ( n => n . Model . CrossLink , n => n )
100110 . ToFrozenDictionary ( ) ;
101111
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ public void ParsesATableOfContents()
1616 IPositionalNavigation positionalNavigation = Generator . DocumentationSet ;
1717 var allKeys = positionalNavigation . NavigationIndexedByCrossLink . Keys ;
1818 allKeys . Should ( ) . Contain ( "docs-builder://testing/nested/index.md" ) ;
19+ allKeys . Should ( ) . Contain ( "docs-builder://testing/nest-under-index/index.md" ) ;
1920
2021 var lookup = Path . Combine ( "testing" , "nested" , "index.md" ) ;
2122 var folder = Path . Combine ( Generator . Context . DocumentationSourceDirectory . FullName , "testing" ) ;
You can’t perform that action at this time.
0 commit comments