Skip to content

Commit 7ff5018

Browse files
authored
Also close pages switcher when clicking on active item (#838)
1 parent 035aeb7 commit 7ff5018

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<h1 class="text-4xl font-bold font-sans text-black">Elastic documentation</h1>
1313
<p class="mt-4">Find the help you need, wherever you are in your Elastic journey.</p>
1414
<div class="flex md:inline-flex gap-3 mt-9">
15-
<a href="@Model.Link("/get-started")" class="grow select-none cursor-pointer text-white text-nowrap bg-blue-elastic hover:bg-blue-elastic-110 focus:ring-4 focus:ring-blue-elastic-50 font-semibold font-sans rounded-sm px-6 py-2 focus:outline-none h-10 flex items-center justify-center">
15+
<a href="@Model.Link("/get-started/")" class="grow select-none cursor-pointer text-white text-nowrap bg-blue-elastic hover:bg-blue-elastic-110 focus:ring-4 focus:ring-blue-elastic-50 font-semibold font-sans rounded-sm px-6 py-2 focus:outline-none h-10 flex items-center justify-center">
1616
Get started
1717
</a>
1818
</div>

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

+6-6
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
<ul class="flex gap-6">
1919
<li class="text-nowrap hover:text-blue-elastic active:text-blue-elastic-100">
2020
<a
21-
href="@Model.Link("/release-notes")"
21+
href="@Model.Link("/release-notes/")"
2222
@Htmx.GetHxAttributes(
23-
targetUrl: Model.Link("/release-notes"),
23+
targetUrl: Model.Link("/release-notes/"),
2424
hxSwapOob: "#main-container"
2525
)
2626
>
@@ -29,9 +29,9 @@
2929
</li>
3030
<li class="text-nowrap hover:text-blue-elastic active:text-blue-elastic-100">
3131
<a
32-
href="@Model.Link("/troubleshoot")"
32+
href="@Model.Link("/troubleshoot/")"
3333
@Htmx.GetHxAttributes(
34-
targetUrl: Model.Link("/troubleshoot"),
34+
targetUrl: Model.Link("/troubleshoot/"),
3535
hxSwapOob: "#main-container"
3636
)
3737
>
@@ -40,9 +40,9 @@
4040
</li>
4141
<li class="text-nowrap hover:text-blue-elastic active:text-blue-elastic-100">
4242
<a
43-
href="@Model.Link("/reference")"
43+
href="@Model.Link("/reference/")"
4444
@Htmx.GetHxAttributes(
45-
Model.Link("/reference"),
45+
Model.Link("/reference/"),
4646
hxSwapOob: "#main-container"
4747
)
4848
>

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

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<summary class="grid grid-cols-[1fr_auto] cursor-pointer font-semibold gap-1 hover:text-black pl-4 pr-2 py-2 group-open:border-b-1 border-grey-20">
1212
<span>
1313
<a
14+
onclick="this.closest('details').removeAttribute('open')"
1415
class="hover:underline text-blue-elastic hover:text-blue-elastic-100"
1516
href="@current.Group.Index?.Url"
1617
@Htmx.GetHxAttributes(current.Group.Index?.Url!, true)

0 commit comments

Comments
 (0)