Skip to content

Commit d387acc

Browse files
authored
Add hx attributes to breadcrumbs links (#579)
1 parent 11c2624 commit d387acc

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

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

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
1+
@using Elastic.Markdown.Helpers
12
@inherits RazorSlice<LayoutViewModel>
23
<ol id="breadcrumbs" class="block w-full" itemscope="" itemtype="https://schema.org/BreadcrumbList">
34
<li class="inline text-ink text-sm hover:text-ink leading-[1.2em] tracking-[-0.02em]" itemprop="itemListElement" itemscope="" itemtype="https://schema.org/ListItem">
4-
<a itemprop="item" href="@Model.UrlPathPrefix/">
5+
<a
6+
itemprop="item"
7+
href="@Model.UrlPathPrefix/"
8+
hx-get="@Model.UrlPathPrefix/"
9+
hx-select-oob="@Htmx.GetHxSelectOob()"
10+
hx-swap="none"
11+
hx-push-url="true"
12+
hx-indicator="#htmx-indicator"
13+
preload="mouseover"
14+
>
515
<span itemprop="name" class="hover:text-ink">Elastic</span>
616
</a>
717
<meta itemprop="position" content="1">
@@ -10,7 +20,16 @@
1020
{
1121
<li class="inline text-gray-500 text-sm leading-[1.2em] tracking-[-0.02em]" itemprop="itemListElement" itemscope="" itemtype="https://schema.org/ListItem">
1222
<span class="px-1">/</span>
13-
<a itemprop="item" href="@item.Url">
23+
<a
24+
itemprop="item"
25+
href="@item.Url"
26+
hx-get="@item.Url"
27+
hx-select-oob="@Htmx.GetHxSelectOob()"
28+
hx-swap="none"
29+
hx-push-url="true"
30+
hx-indicator="#htmx-indicator"
31+
preload="mouseover"
32+
>
1433
<span itemprop="name" class="hover:text-ink">@item.NavigationTitle</span>
1534
</a>
1635
<meta itemprop="position" content="2">

0 commit comments

Comments
 (0)