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