From 15f0b73a11248a732cf81de3c602c201c6c74115 Mon Sep 17 00:00:00 2001 From: Kian Ryan Date: Thu, 20 Jun 2024 08:10:18 +0100 Subject: [PATCH] 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. --- themes/lhs/layouts/blog/list.html | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/themes/lhs/layouts/blog/list.html b/themes/lhs/layouts/blog/list.html index ea9836f..280aab0 100644 --- a/themes/lhs/layouts/blog/list.html +++ b/themes/lhs/layouts/blog/list.html @@ -15,12 +15,14 @@

{{ .Key }}

{{- range .Pages }} -{{ $image := .Resources.GetMatch .Params.listing_image }} -{{ $image = $image.Fill "512x512 Center jpg" }}
- + {{ with .Resources.GetMatch .Params.listing_image }} + {{ $image := . }} + {{ $image = $image.Fill "512x512 Center jpg" }} + + {{ end }}

{{.Title}} - {{ .Params.author }}
@@ -32,4 +34,4 @@

{{- end }} {{- end }} -{{ end }} \ No newline at end of file +{{ end }}