File tree Expand file tree Collapse file tree 4 files changed +2
-10
lines changed
src/Elastic.Markdown/Slices Expand file tree Collapse file tree 4 files changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -49,14 +49,11 @@ private NavigationViewModel CreateNavigationModel(INavigation navigation)
49
49
if ( navigation is not DocumentationGroup tree )
50
50
throw new InvalidOperationException ( "Expected a documentation group" ) ;
51
51
52
- var isRoot = navigation . Id == tree . Id ;
53
-
54
52
return new NavigationViewModel
55
53
{
56
54
Title = tree . Index ? . NavigationTitle ?? "Docs" ,
57
55
TitleUrl = tree . Index ? . Url ?? Set . Build . UrlPathPrefix ?? "/" ,
58
56
Tree = tree ,
59
- IsRoot = isRoot ,
60
57
IsPrimaryNavEnabled = Set . Configuration . Features . IsPrimaryNavEnabled ,
61
58
TopLevelItems = Set . Tree . NavigationItems . OfType < GroupNavigation > ( ) . ToList ( )
62
59
} ;
Original file line number Diff line number Diff line change 60
60
Level = Model .Tree .Depth ,
61
61
SubTree = Model .Tree ,
62
62
RootNavigationId = Model .Tree .Id ,
63
- IsRoot = Model .IsRoot
64
63
} ))
65
64
</ul >
66
65
</div >
Original file line number Diff line number Diff line change 2
2
@using Elastic .Markdown .IO .Navigation
3
3
@inherits RazorSlice <NavigationTreeItem >
4
4
@{
5
- var topLevelGroup = Model .IsRoot ? 1 : 2 ;
6
- var topLevelFile = Model .IsRoot ? 0 : 1 ;
5
+ var topLevelGroup = Model .IsPrimaryNavEnabled ? 2 : 1 ;
6
+ var topLevelFile = Model .IsPrimaryNavEnabled ? 1 : 0 ;
7
7
}
8
8
@foreach ( var item in Model .SubTree .NavigationItems )
9
9
{
66
66
IsPrimaryNavEnabled = Model .IsPrimaryNavEnabled ,
67
67
Level = g .Depth ,
68
68
SubTree = g ,
69
- IsRoot = Model .IsRoot ,
70
69
RootNavigationId = Model .RootNavigationId
71
70
}))
72
71
</ul >
Original file line number Diff line number Diff line change @@ -98,9 +98,7 @@ public class NavigationViewModel
98
98
public required string TitleUrl { get ; init ; }
99
99
public required INavigation Tree { get ; init ; }
100
100
//public required MarkdownFile CurrentDocument { get; init; }
101
- public required bool IsRoot { get ; init ; }
102
101
public required bool IsPrimaryNavEnabled { get ; init ; }
103
-
104
102
public required IEnumerable < GroupNavigation > TopLevelItems { get ; init ; }
105
103
}
106
104
@@ -109,7 +107,6 @@ public class NavigationTreeItem
109
107
public required int Level { get ; init ; }
110
108
//public required MarkdownFile CurrentDocument { get; init; }
111
109
public required INavigation SubTree { get ; init ; }
112
- public required bool IsRoot { get ; init ; }
113
110
public required bool IsPrimaryNavEnabled { get ; init ; }
114
111
public required string RootNavigationId { get ; set ; }
115
112
}
You can’t perform that action at this time.
0 commit comments