fix(navigation): implement persistent shell with client-side highlighting for rock-solid mobile menu
All checks were successful
Deploy Theme / deploy (push) Successful in 14s
All checks were successful
Deploy Theme / deploy (push) Successful in 14s
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
<ul class="nav">
|
||||
{{#foreach navigation}}
|
||||
<li class="{{link_class for=url class=(concat "nav-" slug)}}">
|
||||
{{!--
|
||||
We use Alpine to dynamically apply the nav-current class based on currentPath.
|
||||
This works even when the navigation itself is not swapped by HTMX.
|
||||
--}}
|
||||
<li class="nav-{{slug}}" :class="currentPath === '{{url}}' ? 'nav-current' : ''">
|
||||
<a href="{{url absolute="true"}}" class="nav-link">
|
||||
{{label}}
|
||||
</a>
|
||||
|
||||
Reference in New Issue
Block a user