Skip to content

Commit 3f8a468

Browse files
authored
Fix pages navigation (#528)
1 parent f939f9d commit 3f8a468

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Elastic.Markdown/Slices/Layout/_TocTreeNav.cshtml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<li class="block ml-2 pl-2 border-l-1 border-l-gray-200 group/li @(isCurrent ? "current" : string.Empty)">
1111
<div class="flex">
1212
<a
13-
class="sidebar-link my-1 ml-5 group-[.current]/li:text-blue-elastic! @(isCurrent ? "" : string.Empty)"
13+
class="sidebar-link my-1 ml-5 group-[.current]/li:text-blue-elastic! @(isCurrent ? "pointer-events-none" : string.Empty)"
1414
href="@f.Url"
1515
@(isCurrent ? "aria-current=page" : string.Empty)>
1616
@f.NavigationTitle
@@ -22,12 +22,12 @@
2222
{
2323
var g = folder.Group;
2424
var isCurrent = g.Index == Model.CurrentDocument;
25-
var slug = g.Index?.Title.Slugify();
2625
const int initialExpandLevel = 1;
2726
var containsCurrent = g.HoldsCurrent(Model.CurrentDocument) || g.ContainsCurrentPage(Model.CurrentDocument);
2827
var shouldInitiallyExpand = containsCurrent || g.Depth <= initialExpandLevel;
28+
var uuid = Guid.NewGuid().ToString();
2929
<li class="flex flex-wrap @(g.Depth > 1 ? "ml-2 pl-2 border-l-1 border-l-gray-200" : string.Empty)">
30-
<label for="@slug" class="peer group/label flex items-center overflow-hidden @(g.Depth == 1 ? "mt-2" : "")">
30+
<label for="@uuid" class="peer group/label flex items-center overflow-hidden @(g.Depth == 1 ? "mt-2" : "")">
3131
<svg
3232
xmlns="http://www.w3.org/2000/svg"
3333
fill="none"
@@ -38,7 +38,7 @@
3838
<path stroke-linecap="round" stroke-linejoin="round" d="m19.5 8.25-7.5 7.5-7.5-7.5"/>
3939
</svg>
4040
<input
41-
id="@slug"
41+
id="@uuid"
4242
type="checkbox"
4343
class="hidden"
4444
aria-hidden="true"
@@ -47,7 +47,7 @@
4747
>
4848
<a
4949
href="@g.Index?.Url"
50-
class="sidebar-link inline-block my-1 @(g.Depth == 1 ? "uppercase tracking-[0.05em] text-ink-light font-semibold" : string.Empty) @(containsCurrent ? "font-semibold" : string.Empty) @(isCurrent ? "current text-blue-elastic!" : string.Empty)">
50+
class="sidebar-link inline-block my-1 @(g.Depth == 1 ? "uppercase tracking-[0.05em] text-ink-light font-semibold" : string.Empty) @(containsCurrent ? "font-semibold" : string.Empty) @(isCurrent ? "current pointer-events-none text-blue-elastic!" : string.Empty)">
5151
@g.Index?.NavigationTitle
5252
</a>
5353
</label>

0 commit comments

Comments
 (0)