mirror of
https://github.com/CaiJimmy/hugo-theme-stack.git
synced 2024-11-23 18:31:45 +01:00
fix: use absLangURL for menu url
To avoid problem when the site is hosted in subdirectory
This commit is contained in:
parent
779982eb95
commit
4267346a4a
2 changed files with 3 additions and 3 deletions
|
@ -64,13 +64,13 @@ DefaultContentLanguage = "en" # Theme i18n support
|
||||||
[[menu.main]]
|
[[menu.main]]
|
||||||
identifier = "about-cn"
|
identifier = "about-cn"
|
||||||
name = "About"
|
name = "About"
|
||||||
url = "/about/"
|
url = "about"
|
||||||
weight = -90
|
weight = -90
|
||||||
pre = "user"
|
pre = "user"
|
||||||
[[menu.main]]
|
[[menu.main]]
|
||||||
identifier = "archives"
|
identifier = "archives"
|
||||||
name = "Archives"
|
name = "Archives"
|
||||||
url = "/archives/"
|
url = "archives"
|
||||||
weight = -70
|
weight = -70
|
||||||
pre = "archives"
|
pre = "archives"
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
{{ $active := or (eq $currentPage.Title .Name) (or ($currentPage.HasMenuCurrent "main" .) ($currentPage.IsMenuCurrent "main" .)) }}
|
{{ $active := or (eq $currentPage.Title .Name) (or ($currentPage.HasMenuCurrent "main" .) ($currentPage.IsMenuCurrent "main" .)) }}
|
||||||
|
|
||||||
<li {{ if $active }} class='current' {{ end }}>
|
<li {{ if $active }} class='current' {{ end }}>
|
||||||
<a href='{{ .URL }}'>
|
<a href='{{ .URL | absLangURL }}'>
|
||||||
{{ if .Pre }}
|
{{ if .Pre }}
|
||||||
{{ (resources.Get (delimit (slice "icons/" .Pre ".svg") "")).Content | safeHTML }}
|
{{ (resources.Get (delimit (slice "icons/" .Pre ".svg") "")).Content | safeHTML }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
Loading…
Reference in a new issue