mirror of
https://github.com/CaiJimmy/hugo-theme-stack.git
synced 2025-04-29 20:13:31 +08:00
feat(menu): support open an entry in new tab
closes https://github.com/CaiJimmy/hugo-theme-stack/issues/230
This commit is contained in:
parent
a052245f28
commit
56c1d86eab
@ -142,6 +142,9 @@ menu:
|
|||||||
url: /
|
url: /
|
||||||
weight: -100
|
weight: -100
|
||||||
pre: home
|
pre: home
|
||||||
|
params:
|
||||||
|
### For demonstration purpose, the home link will be open in a new tab
|
||||||
|
newTab: true
|
||||||
|
|
||||||
related:
|
related:
|
||||||
includeNewer: true
|
includeNewer: true
|
||||||
@ -157,7 +160,7 @@ related:
|
|||||||
markup:
|
markup:
|
||||||
tableOfContents:
|
tableOfContents:
|
||||||
endLevel: 4
|
endLevel: 4
|
||||||
ordered: true
|
ordered: false
|
||||||
startLevel: 2
|
startLevel: 2
|
||||||
highlight:
|
highlight:
|
||||||
noClasses: false
|
noClasses: false
|
||||||
|
@ -39,7 +39,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 }}' {{ if eq .Params.newTab true }}target="_blank"{{ end }}>
|
||||||
{{ if .Pre }}
|
{{ if .Pre }}
|
||||||
{{ partial "helper/icon" .Pre }}
|
{{ partial "helper/icon" .Pre }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
Loading…
Reference in New Issue
Block a user