-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
251 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Bar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Qux |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Foo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Deeply Nested |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,22 @@ | ||
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap'); | ||
@font-face { | ||
font-family: "Inter"; | ||
src: url("./fonts/InterVariable.woff2") format("woff2"); | ||
} | ||
|
||
@font-face { | ||
font-family: "Mier B"; | ||
src: url("./fonts/MierB-Regular.woff2") format("woff2"); | ||
font-weight: normal; | ||
} | ||
|
||
@font-face { | ||
font-family: "Mier B"; | ||
src: url("./fonts/MierB-Bold.woff2") format("woff2"); | ||
font-weight: bold; | ||
} | ||
|
||
@font-face { | ||
font-family: "Mier B"; | ||
src: url("./fonts/MierB-Regular.woff2") format("woff2") | ||
src: url("./fonts/MierB-Demi.woff2") format("woff2"); | ||
font-weight: 600; | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,37 @@ | ||
@inherits RazorSlice<NavigationViewModel> | ||
<aside id="lside" class="sy-lside md:w-72 md:shrink-0 print:hidden"> | ||
<div class="sy-lside-inner md:sticky"> | ||
<div class="sy-scrollbar p-6"> | ||
<div class="globaltoc" data-expand-depth="0"> | ||
<p class="caption" role="heading" aria-level="3"> | ||
<span class="caption-text">Elastic Docs Guide</span> | ||
</p> | ||
<ul class="current">@await RenderPartialAsync(_TocTreeNav.Create(new NavigationTreeItem | ||
{ | ||
Level = Model.Tree.Depth, | ||
SubTree = Model.Tree, | ||
CurrentDocument = Model.CurrentDocument | ||
})) | ||
</ul> | ||
|
||
@if (Model.IsRedesign) | ||
{ | ||
<div class="pt-6 sticky"> | ||
<ul class="block w-full"> | ||
@await RenderPartialAsync(_TocTreeNav.Create(new NavigationTreeItem | ||
{ | ||
Level = Model.Tree.Depth, | ||
SubTree = Model.Tree, | ||
CurrentDocument = Model.CurrentDocument | ||
})) | ||
</ul> | ||
</div> | ||
} | ||
else | ||
{ | ||
<aside id="lside" class="sy-lside md:w-72 md:shrink-0 print:hidden"> | ||
<div class="sy-lside-inner md:sticky"> | ||
<div class="sy-scrollbar p-6"> | ||
<div class="globaltoc" data-expand-depth="0"> | ||
<p class="caption" role="heading" aria-level="3"> | ||
<span class="caption-text">Elastic Docs Guide</span> | ||
</p> | ||
<ul class="current">@await RenderPartialAsync(_TocTreeNav.Create(new NavigationTreeItem | ||
{ | ||
Level = Model.Tree.Depth, | ||
SubTree = Model.Tree, | ||
CurrentDocument = Model.CurrentDocument | ||
})) | ||
</ul> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</aside> | ||
<div class="lside-overlay js-menu" role="button" aria-label="Close left sidebar" aria-controls="lside" aria-expanded="false"></div> | ||
</aside> | ||
<div class="lside-overlay js-menu" role="button" aria-label="Close left sidebar" aria-controls="lside" aria-expanded="false"></div> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,95 @@ | ||
@using Elastic.Markdown.IO.Navigation | ||
@inherits RazorSlice<NavigationTreeItem> | ||
@foreach (var item in Model.SubTree.NavigationItems) | ||
@if (Model.IsRedesign) | ||
{ | ||
if (item is FileNavigation file) | ||
@foreach (var item in Model.SubTree.NavigationItems) | ||
{ | ||
var f = file.File; | ||
var current = f == Model.CurrentDocument ? " current" : string.Empty; | ||
<li class="toctree-l@(Model.SubTree.Depth + 1)@current"><a class="@(current.Trim()) reference internal" href="@f.Url">@f.NavigationTitle</a></li> | ||
if (item is FileNavigation file) | ||
{ | ||
var f = file.File; | ||
var isCurrent = f == Model.CurrentDocument; | ||
<li class="block pl-6 pb-2 w-full @(isCurrent ? "current" : string.Empty)"> | ||
<div class="flex"> | ||
<div class="w-6"> | ||
</div> | ||
<a | ||
class="block w-full hover:font-bold @(isCurrent ? "font-bold text-blue-elastic" : string.Empty) " | ||
href="@f.Url"> | ||
@f.NavigationTitle | ||
</a> | ||
</div> | ||
|
||
</li> | ||
} | ||
else if (item is GroupNavigation folder) | ||
{ | ||
var g = folder.Group; | ||
var isCurrent = g.Index == Model.CurrentDocument; | ||
const int initialExpandLevel = 1; | ||
var shouldExpand = g.HoldsCurrent(Model.CurrentDocument) || g.Depth <= initialExpandLevel || g.ContainsCurrentPage(Model.CurrentDocument); | ||
<li class="block pl-6 pb-2"> | ||
<div class="flex items-center"> | ||
<div class="w-6"> | ||
@if (g.NavigationItems.Count > 0) | ||
{ | ||
<label for="@g.Index?.Title"> | ||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-4 cursor-pointer"> | ||
<path stroke-linecap="round" stroke-linejoin="round" d="m19.5 8.25-7.5 7.5-7.5-7.5"/> | ||
</svg> | ||
</label> | ||
} | ||
</div> | ||
<a | ||
href="@g.Index?.Url" | ||
class="block w-full hover:font-bold @(isCurrent ? "font-bold text-blue-elastic" : string.Empty) "> | ||
@g.Index?.NavigationTitle | ||
</a> | ||
</div> | ||
<input | ||
id="@g.Index?.Title" | ||
type="checkbox" | ||
class="peer hidden" | ||
@(shouldExpand ? "checked" : string.Empty)> | ||
@if (g.NavigationItems.Count > 0) | ||
{ | ||
<ul class="h-0 peer-checked:h-auto w-full overflow-hidden mt-2" data-has-current="@g.ContainsCurrentPage(Model.CurrentDocument)"> | ||
@await RenderPartialAsync(_TocTreeNav.Create(new NavigationTreeItem | ||
{ | ||
Level = g.Depth, | ||
CurrentDocument = Model.CurrentDocument, | ||
SubTree = g | ||
})) | ||
</ul> | ||
} | ||
</li> | ||
} | ||
} | ||
else if (item is GroupNavigation folder) | ||
} | ||
else | ||
{ | ||
@foreach (var item in Model.SubTree.NavigationItems) | ||
{ | ||
var g = folder.Group; | ||
var current = g.HoldsCurrent(Model.CurrentDocument) ? " current" : string.Empty; | ||
var currentFile = g.Index == Model.CurrentDocument ? " current" : string.Empty; | ||
<li class="toctree-l@(g.Depth)@current"><a class="reference internal@(currentFile)" href="@g.Index?.Url">@g.Index?.NavigationTitle</a>@if (@g.NavigationItems.Count > 0) {<ul class="@(current.Trim())"> | ||
@await RenderPartialAsync(_TocTreeNav.Create(new NavigationTreeItem | ||
{ | ||
Level = g.Depth, | ||
CurrentDocument = Model.CurrentDocument, | ||
SubTree = g | ||
})) | ||
</ul> | ||
} | ||
</li> | ||
if (item is FileNavigation file) | ||
{ | ||
var f = file.File; | ||
var current = f == Model.CurrentDocument ? " current" : string.Empty; | ||
<li class="toctree-l@(Model.SubTree.Depth + 1)@current"><a class="@(current.Trim()) reference internal" href="@f.Url">@f.NavigationTitle</a></li> | ||
} | ||
else if (item is GroupNavigation folder) | ||
{ | ||
var g = folder.Group; | ||
var current = g.HoldsCurrent(Model.CurrentDocument) ? " current" : string.Empty; | ||
var currentFile = g.Index == Model.CurrentDocument ? " current" : string.Empty; | ||
<li class="toctree-l@(g.Depth)@current"><a class="reference internal@(currentFile)" href="@g.Index?.Url">@g.Index?.NavigationTitle</a>@if (@g.NavigationItems.Count > 0) {<ul class="@(current.Trim())"> | ||
@await RenderPartialAsync(_TocTreeNav.Create(new NavigationTreeItem | ||
{ | ||
Level = g.Depth, | ||
CurrentDocument = Model.CurrentDocument, | ||
SubTree = g | ||
})) | ||
</ul> | ||
} | ||
</li> | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.