mark nav item as active for sub-pages
When navigating to e.g. a single blog page, the nav item this page is in is now marked as active so users know in which area of the site they are navigating at the moment.
This commit is contained in:
parent
54a3c60735
commit
13d9b3842e
@ -108,7 +108,7 @@
|
|||||||
<li>
|
<li>
|
||||||
<a href="{{ .URL | absLangURL }}" title="{{ .Title | default .Name }} {{- cond $is_search (" (Alt + /)" | safeHTMLAttr) ("" | safeHTMLAttr ) }}"
|
<a href="{{ .URL | absLangURL }}" title="{{ .Title | default .Name }} {{- cond $is_search (" (Alt + /)" | safeHTMLAttr) ("" | safeHTMLAttr ) }}"
|
||||||
{{- cond $is_search (" accesskey=/" | safeHTMLAttr) ("" | safeHTMLAttr ) }}>
|
{{- cond $is_search (" accesskey=/" | safeHTMLAttr) ("" | safeHTMLAttr ) }}>
|
||||||
<span {{- if eq $menu_item_url $page_url }} class="active" {{- end }}>
|
<span {{- if hasPrefix $page_url $menu_item_url }} class="active" {{- end }}>
|
||||||
{{- .Pre }}
|
{{- .Pre }}
|
||||||
{{- .Name -}}
|
{{- .Name -}}
|
||||||
{{ .Post -}}
|
{{ .Post -}}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user