From fd469910def1260130dc3bb00b6e7a95c188683e Mon Sep 17 00:00:00 2001 From: Will Faught Date: Fri, 12 Jul 2024 23:04:03 -0700 Subject: [PATCH] Add first, last page header includes --- README.md | 2 ++ layouts/partials/paige/page-header.html | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6db84788..3f09e585 100644 --- a/README.md +++ b/README.md @@ -913,6 +913,8 @@ Body: None. | `yoursite/layouts/partials/paige/head-last.html` | The end of the head tag | | `yoursite/layouts/partials/paige/main-first.html` | The beginning of the main tag | | `yoursite/layouts/partials/paige/main-last.html` | The end of the main tag | +| `yoursite/layouts/partials/paige/page-header-first.html` | The beginning of the page header tag | +| `yoursite/layouts/partials/paige/page-header-last.html` | The end of the page header tag | | `yoursite/layouts/partials/paige/site-header-first.html` | The beginning of the site header tag | | `yoursite/layouts/partials/paige/site-header-last.html` | The end of the site header tag | | `yoursite/layouts/partials/paige/style-first.css` | The beginning of the style tag | diff --git a/layouts/partials/paige/page-header.html b/layouts/partials/paige/page-header.html index 25464f81..2e0ca486 100644 --- a/layouts/partials/paige/page-header.html +++ b/layouts/partials/paige/page-header.html @@ -6,6 +6,8 @@ {{ $date := and $page.IsPage $page.PublishDate }} {{ $dateformat := $page.Param "paige.date_format" | default ":date_long" }} {{ $description := $page.Description | markdownify }} +{{ $first := templates.Exists "partials/paige/page-header-first.html" }} +{{ $last := templates.Exists "partials/paige/page-header-last.html" }} {{ $link := $page.Params.link }} {{ $readingtime := $page.ReadingTime }} {{ $series := $page.GetTerms "series" }} @@ -16,8 +18,12 @@ {{ $keywords := sort (append $categories $tags) "Title" }} -{{ if or $authors $date $description $keywords $readingtime $series $table $title }} +{{ if or $authors $date $description $first $keywords $last $readingtime $series $table $title }}
+ {{ if $first }} + {{ partial "paige/page-header-first.html" . }} + {{ end }} + {{ with $title }}

{{ if $link }}{{ . }}{{ else }}{{ . }}{{ end }}

{{ end }} @@ -87,5 +93,9 @@ {{ end }} + + {{ if $last }} + {{ partial "paige/page-header-last.html" . }} + {{ end }}
{{ end }}