Add tabs menu style

master
Will Faught 2 years ago
parent b22de81f9e
commit 1649a9566e

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

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

Loading…
Cancel
Save