From 6dbc56c2b68f52e5fc4143d254f5d41a564b9086 Mon Sep 17 00:00:00 2001 From: Will Faught Date: Fri, 12 Jul 2024 17:20:17 -0700 Subject: [PATCH] Complete site header logic --- layouts/partials/paige/site-header.html | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/layouts/partials/paige/site-header.html b/layouts/partials/paige/site-header.html index 67590879..b9fffd84 100644 --- a/layouts/partials/paige/site-header.html +++ b/layouts/partials/paige/site-header.html @@ -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 }}
- {{ if templates.Exists "partials/paige/header-first.html" }} + {{ if $first }} {{ partial "paige/header-first.html" $page }} {{ end }} @@ -46,7 +50,7 @@ {{ end }} - {{ with site.Menus.main }} + {{ with $menu }} {{ end }} - {{ with .Ancestors }} + {{ with $ancestors }} {{ end }} - {{ if templates.Exists "partials/paige/header-last.html" }} + {{ if $last }} {{ partial "paige/header-last.html" $page }} {{ end }}