File tree Expand file tree Collapse file tree 7 files changed +13
-20
lines changed Expand file tree Collapse file tree 7 files changed +13
-20
lines changed Original file line number Diff line number Diff line change 1
1
Title: Debug Adapter Protocol
2
2
ShowInSidebar: true
3
+ Order: 3
3
4
---
Original file line number Diff line number Diff line change @@ -2,8 +2,6 @@ Title: C# Language Server Protocol
2
2
NoSidebar: false
3
3
ShowInSidebar: false
4
4
NoTitle: true
5
- ArchiveSources: '* .md'
6
- ArchiveOrderDescending: true
7
5
---
8
6
9
7
# Welcome!
Original file line number Diff line number Diff line change 1
1
Title: JSON RPC
2
2
ShowInSidebar: true
3
+ Order: 2
3
4
---
4
5
5
6
# Using Json Rpc Standalone
Original file line number Diff line number Diff line change 1
1
Title: Language Server Protocol
2
2
ShowInSidebar: true
3
+ Order: 1
3
4
---
4
5
5
6
# Implementing the Language Server Protocol
Original file line number Diff line number Diff line change 1
1
Title: Source Generators
2
2
ShowInSidebar: true
3
+ Order: 4
3
4
---
4
5
5
6
# Source Generators
Original file line number Diff line number Diff line change 1
1
@{
2
- // Get the root
3
- IDocumentPathTree <IDocument > tree = Outputs .AsSourceTree ();
4
- IDocument root = Document ;
5
- IDocument parent = tree .GetParentOf (root );
6
- while (parent != null )
7
- {
8
- root = parent ;
9
- parent = tree .GetParentOf (root );
10
- }
2
+ IDocument root = OutputPages [Document .Destination .ChangeFileName (" index.html" ).FullPath ].First ();
11
3
12
4
// Display the menu
13
- IReadOnlyList <IDocument > children = root .GetDocumentList (Keys .Children );
5
+ DocumentList <IDocument > children = OutputPages .GetChildrenOf (root )
6
+ .Where (x => x .GetBool (SamsonKeys .ShowInSidebar ))
7
+ .ToDocumentList ();
8
+
14
9
if (children != null && children .Count > 0 )
15
10
{
16
11
@Html .Partial (" Sidebar/_ChildPagesMenu" , children )
Original file line number Diff line number Diff line change 1
- @inherits Statiq .Razor .StatiqRazorPage <IReadOnlyList <IDocument >>
1
+ @inherits Statiq .Razor .StatiqRazorPage <DocumentList <IDocument >>
2
2
3
3
@{
4
4
// Group by category
19
19
.OrderBy (x => x .Get <int >(SamsonKeys .Order , 1000 ))
20
20
.ThenBy (x => x .WithoutSettings ().GetString (Keys .Title )))
21
21
{
22
- // object[] currentTreePath = /Document.Get<object[]>(Keys.TreePath);
23
- // object[] childTreePath = child.Get<object[]>(Keys.TreePath);
24
- // string childTitle = child.WithoutSettings().GetString(Keys.Title, childTreePath.Last().ToString());
25
- // string parentActive = currentTreePath.Take(childTreePath.Length).SequenceEqual(childTreePath) ? "active" : null;
26
- // string childSelected = parentActive != null && currentTreePath.Length == childTreePath.Length ? "selected" : null;
27
- string parentActive = " active" ;
28
- string childSelected = " selected" ;
22
+ // TODO: this doesn't take into account if a child is active.
23
+ string ? parentActive = Document .IdEquals (child ) ? " active" : null ;
24
+ string ? childSelected = Document .IdEquals (child ) ? " selected" : null ;
29
25
string childTitle = child .GetTitle ();
30
26
IReadOnlyList <IDocument > children = child .GetDocumentList (Keys .Children );
31
27
if (children != null && children .Count > 0 )
You can’t perform that action at this time.
0 commit comments