Add first, last page header includes

master
Will Faught 12 months ago
parent 2d40e2c4c8
commit fd469910de

@ -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 |

@ -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 }}
<header class="align-items-center d-flex flex-column mw-100" id="paige-page-header">
{{ if $first }}
{{ partial "paige/page-header-first.html" . }}
{{ end }}
{{ with $title }}
<h1 class="fw-bold text-center" id="paige-title">{{ if $link }}<a href="{{ $link }}">{{ . }}</a>{{ else }}{{ . }}{{ end }}</h1>
{{ end }}
@ -87,5 +93,9 @@
</div>
</div>
{{ end }}
{{ if $last }}
{{ partial "paige/page-header-last.html" . }}
{{ end }}
</header>
{{ end }}

Loading…
Cancel
Save