Files
website-hugo/themes/lhs/layouts/blog/list.html
Kian Ryan 15f0b73a11 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.
2024-06-20 08:10:18 +01:00

38 lines
1.1 KiB
HTML

{{ define "title" }}
{{ .Title }}
{{ end }}
{{ define "subtitle" }}
{{ .Params.subtitle }}
{{ end }}
{{ define "content" }}
{{ .Content }}
<p><i>Subscribe to our <a href="index.xml" type="application/rss+xml" >RSS feed</a> to keep up to date with new posts.</i></p>
{{- range .Data.Pages.GroupByDate "2006" }}
<h3 id="{{ .Key }}">{{ .Key }}</h3>
{{- range .Pages }}
<div class="box">
<div class="columns">
<div class="column is-one-quarter has-text-centered is-hidden-mobile">
{{ 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 />
<span class="is-size-6">{{ dateFormat "Jan 2, 2006" .PublishDate }}</span>
</p>
<p class="is-size-6"><i>{{ .Summary }}</i></p>
</div>
</div>
</div>
{{- end }}
{{- end }}
{{ end }}