No header images in blog no longer crash site

A lack of listing_image on frontmatter caused the site to hard crash,
rendering it difficult to develop new content.  Have changed the
listing template so blog posts can be rendered without a listing_image.
This commit is contained in:
Kian Ryan
2024-06-20 08:10:18 +01:00
parent 71119c9eb8
commit 15f0b73a11

View File

@@ -15,12 +15,14 @@
<h3 id="{{ .Key }}">{{ .Key }}</h3>
{{- range .Pages }}
{{ $image := .Resources.GetMatch .Params.listing_image }}
{{ $image = $image.Fill "512x512 Center jpg" }}
<div class="box">
<div class="columns">
<div class="column is-one-quarter has-text-centered is-hidden-mobile">
<img src="{{ $image.RelPermalink }}" class="image is-inline-block" alt="">
{{ with .Resources.GetMatch .Params.listing_image }}
{{ $image := . }}
{{ $image = $image.Fill "512x512 Center jpg" }}
<img src="{{ $image.RelPermalink }}" class="image is-inline-block" alt="">
{{ end }}
</div>
<div class="column">
<p><a href="{{ .RelPermalink }}">{{.Title}}</a> - {{ .Params.author }}<br />
@@ -32,4 +34,4 @@
</div>
{{- end }}
{{- end }}
{{ end }}
{{ end }}