Complete site header logic

master
Will Faught 12 months ago
parent 83646fa829
commit 6dbc56c2b6

@ -1,8 +1,12 @@
{{ $page := . }}
{{ $ancestors := $page.Ancestors }}
{{ $basepath := path.Clean (urls.Parse (relLangURL "")).Path }}
{{ $description := $page.Param "paige.site_description" }}
{{ $first := templates.Exists "partials/paige/header-first.html" }}
{{ $last := templates.Exists "partials/paige/header-last.html" }}
{{ $links := false }}
{{ $menu := site.Menus.main }}
{{ $pills := false }}
{{ $tabs := false }}
{{ $title := $page.Param "paige.site_title" }}
@ -28,9 +32,9 @@
{{ $links = true }}
{{ end }}
{{ if or $page.Ancestors site.Menus.main }}
{{ if or $ancestors $description $first $last $menu $title }}
<header class="my-3" id="paige-header">
{{ if templates.Exists "partials/paige/header-first.html" }}
{{ if $first }}
{{ partial "paige/header-first.html" $page }}
{{ end }}
@ -46,7 +50,7 @@
</div>
{{ end }}
{{ with site.Menus.main }}
{{ with $menu }}
<nav>
<ul class="align-items-center justify-content-center nav {{ if $pills }} nav-pills {{ else if $tabs }} nav-tabs {{ else if $underline }} nav-underline {{ end }}">
{{ range . }}
@ -80,7 +84,7 @@
</nav>
{{ end }}
{{ with .Ancestors }}
{{ with $ancestors }}
<nav aria-label="{{ i18n `paige_breadcrumbs` }}" class="mt-3" id="paige-breadcrumbs">
<div class="d-flex justify-content-center">
<ol class="breadcrumb mb-0">
@ -102,7 +106,7 @@
</nav>
{{ end }}
{{ if templates.Exists "partials/paige/header-last.html" }}
{{ if $last }}
{{ partial "paige/header-last.html" $page }}
{{ end }}
</header>

Loading…
Cancel
Save