Add underline menu style
This commit is contained in:
@@ -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" or "pills"
|
style: "pills" # Must be "links", "pills", 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 }}
|
||||||
|
{{ $underline := false }}
|
||||||
|
|
||||||
{{ if eq $basepath "/" }}
|
{{ if eq $basepath "/" }}
|
||||||
{{ $basepath = "" }}
|
{{ $basepath = "" }}
|
||||||
@@ -13,6 +14,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 . "underline" }}
|
||||||
|
{{ $underline = true }}
|
||||||
{{ else if ne . "links" }}
|
{{ else if ne . "links" }}
|
||||||
{{ errorf "paige/menu: invalid menu style: %q" . }}
|
{{ errorf "paige/menu: invalid menu style: %q" . }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
@@ -26,7 +29,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 {{ 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 . }}
|
{{ range . }}
|
||||||
{{ $menupath := strings.TrimPrefix $basepath .URL }}
|
{{ $menupath := strings.TrimPrefix $basepath .URL }}
|
||||||
{{ $home := (and (eq $menupath "/") (eq $pagepath "/")) }}
|
{{ $home := (and (eq $menupath "/") (eq $pagepath "/")) }}
|
||||||
|
Reference in New Issue
Block a user