mirror of
https://github.com/adityatelange/hugo-PaperMod.git
synced 2024-12-24 22:15:52 -05:00
🐛 Fix menu localization: site.Menus URLs are already localized
This commit is contained in:
parent
a2eb47bb4b
commit
58df123500
@ -122,11 +122,11 @@
|
|||||||
{{- $currentPage := . }}
|
{{- $currentPage := . }}
|
||||||
<ul id="menu">
|
<ul id="menu">
|
||||||
{{- range site.Menus.main }}
|
{{- range site.Menus.main }}
|
||||||
{{- $menu_item_url := (cond (strings.HasSuffix .URL "/") .URL (printf "%s/" .URL) ) | absLangURL }}
|
{{- $menu_item_url := (cond (strings.HasSuffix .URL "/") .URL (printf "%s/" .URL) ) }}
|
||||||
{{- $page_url:= $currentPage.Permalink | absLangURL }}
|
{{- $page_url:= $currentPage.Permalink }}
|
||||||
{{- $is_search := eq (site.GetPage .KeyName).Layout `search` }}
|
{{- $is_search := eq (site.GetPage .KeyName).Layout `search` }}
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ .URL | absLangURL }}" title="{{ .Title | default .Name }} {{- cond $is_search (" (Alt + /)" | safeHTMLAttr) ("" | safeHTMLAttr ) }}"
|
<a href="{{ .URL }}" 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 eq $menu_item_url $page_url }} class="active" {{- end }}>
|
||||||
{{- .Pre }}
|
{{- .Pre }}
|
||||||
|
Loading…
Reference in New Issue
Block a user