Complete site header logic
This commit is contained in:
@@ -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>
|
||||
|
Reference in New Issue
Block a user