Add paige.divider_above menu config

master
Will Faught 12 months ago
parent 53b4c1f9be
commit 0520f92be9

@ -331,12 +331,15 @@ url = "/blog/"
weight = 20 weight = 20
[[languages.en.menu.main]] [[languages.en.menu.main]]
identifier = "life" identifier = "personal"
name = "Life" name = "Personal"
parent = "blog" parent = "blog"
url = "/blog/life/" url = "/blog/personal/"
weight = 10 weight = 10
[languages.en.menu.main.params.paige]
divider_below = true
[[languages.en.menu.main]] [[languages.en.menu.main]]
identifier = "work" identifier = "work"
name = "Work" name = "Work"
@ -345,7 +348,7 @@ url = "/blog/work/"
weight = 20 weight = 20
[languages.en.menu.main.params.paige] [languages.en.menu.main.params.paige]
divider_below = true disabled = true
[[languages.en.menu.main]] [[languages.en.menu.main]]
identifier = "interests" identifier = "interests"
@ -355,19 +358,7 @@ url = "/blog/interests/"
weight = 30 weight = 30
[languages.en.menu.main.params.paige] [languages.en.menu.main.params.paige]
disabled = true divider_above = true
[[languages.en.menu.main]]
identifier = "tags"
name = "Tags"
url = "/tags/"
weight = 30
[[languages.en.menu.main]]
identifier = "search"
name = "Search"
url = "/search/"
weight = 40
``` ```
If you intend for the menu to be sufficient for all navigation, If you intend for the menu to be sufficient for all navigation,

@ -62,6 +62,12 @@
{{ with .Children }} {{ with .Children }}
<ul class="dropdown-menu"> <ul class="dropdown-menu">
{{ range . }} {{ range . }}
{{ if .Params.paige.divider_above }}
<li>
<hr class="dropdown-divider">
</li>
{{ end }}
<li> <li>
<a class="{{ if .Params.paige.disabled }} disabled {{ end }} dropdown-item" href="{{ .URL | safeURL }}" {{ with partial "paige/target.html" (dict "page" $page "url" .URL) }} target="{{ . }}" {{ end }}>{{ .Name }}</a> <a class="{{ if .Params.paige.disabled }} disabled {{ end }} dropdown-item" href="{{ .URL | safeURL }}" {{ with partial "paige/target.html" (dict "page" $page "url" .URL) }} target="{{ . }}" {{ end }}>{{ .Name }}</a>
</li> </li>

Loading…
Cancel
Save