mirror of
https://github.com/nikdoof/website-hugo.git
synced 2025-12-14 11:32:26 +00:00
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:
@@ -15,12 +15,14 @@
|
|||||||
<h3 id="{{ .Key }}">{{ .Key }}</h3>
|
<h3 id="{{ .Key }}">{{ .Key }}</h3>
|
||||||
|
|
||||||
{{- range .Pages }}
|
{{- range .Pages }}
|
||||||
{{ $image := .Resources.GetMatch .Params.listing_image }}
|
|
||||||
{{ $image = $image.Fill "512x512 Center jpg" }}
|
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<div class="columns">
|
<div class="columns">
|
||||||
<div class="column is-one-quarter has-text-centered is-hidden-mobile">
|
<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>
|
||||||
<div class="column">
|
<div class="column">
|
||||||
<p><a href="{{ .RelPermalink }}">{{.Title}}</a> - {{ .Params.author }}<br />
|
<p><a href="{{ .RelPermalink }}">{{.Title}}</a> - {{ .Params.author }}<br />
|
||||||
@@ -32,4 +34,4 @@
|
|||||||
</div>
|
</div>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|||||||
Reference in New Issue
Block a user