Add underline menu style

master
Will Faught 2 years ago
parent 38da9652bc
commit b22de81f9e

@ -218,7 +218,7 @@ paige:
math: false # Enable math typesetting
menu:
breakpoint: "sm" # Bootstrap breakpoint at which to display all menu items
style: "pills" # Must be "links" or "pills"
style: "pills" # Must be "links", "pills", or "underline"
rss:
hide_page: false
managing_editor: ""

@ -3,6 +3,7 @@
{{ $basepath := path.Clean (urls.Parse site.BaseURL).Path }}
{{ $breakpoint := $page.Param "paige.menu.breakpoint" | default "sm" }}
{{ $pills := false }}
{{ $underline := false }}
{{ if eq $basepath "/" }}
{{ $basepath = "" }}
@ -13,6 +14,8 @@
{{ with $page.Param "paige.menu.style" }}
{{ if eq . "pills" }}
{{ $pills = true }}
{{ else if eq . "underline" }}
{{ $underline = true }}
{{ else if ne . "links" }}
{{ errorf "paige/menu: invalid menu style: %q" . }}
{{ end }}
@ -26,7 +29,7 @@
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse justify-content-center mt-3 mt-{{ $breakpoint }}-0 navbar-collapse" id="paige-menu-toggler">
<div class="align-items-center flex-column flex-{{ $breakpoint }}-row justify-content-center nav {{ if $pills }} nav-pills {{ end }}">
<div class="align-items-center flex-column flex-{{ $breakpoint }}-row justify-content-center nav {{ if $pills }} nav-pills {{ else if $underline }} nav-underline {{ end }}">
{{ range . }}
{{ $menupath := strings.TrimPrefix $basepath .URL }}
{{ $home := (and (eq $menupath "/") (eq $pagepath "/")) }}

Loading…
Cancel
Save