Create templates for title, description, date

This commit is contained in:
Will Faught
2022-12-11 21:51:24 -08:00
parent 0686e8aa37
commit de7e4135ba
5 changed files with 29 additions and 34 deletions

View File

@@ -1,23 +1,7 @@
{{ define "main" }}
{{ $title := .Title }}
{{ if not $title }}
{{ $title = .Site.Title }}
{{ end }}
{{ if $title }}
<h1 class="display-1 fw-bold text-center">
{{ if .Params.link }}
<a href="{{ .Params.link }}">{{ $title | markdownify }}</a>
{{ else }}
{{ $title | markdownify }}
{{ end }}
</h1>
{{ end }}
{{ if .Description }}
<p class="lead text-center">{{ .Description | markdownify }}</p>
{{ end }}
{{ if .PublishDate }}
<p class="text-center text-muted"><time datetime="{{ .PublishDate.Format `2006-01-02` }}">{{ .PublishDate.Format "January 2, 2006" }}</time></p>
{{ end }}
{{ partial "paige_title_content.html" . }}
{{ partial "paige_description.html" . }}
{{ partial "paige_date.html" . }}
{{ if .Params.stretch }}
<div class="rounded-4 shadow" style="background-image: url('{{ relURL .Params.stretch }}'); background-position: center; background-size: cover; height: 20rem; max-width: 100%"></div>
{{ end }}