[LAYOUT] Add default archive banner if no thumb.jpg image exist

This commit is contained in:
Gregory Trolliet 2023-09-08 20:59:37 +02:00
parent f9fb6e3ec5
commit 93477924f7

View file

@ -1,5 +1,10 @@
<a class="archive hidden_link" href="{{ .Params.ExternalLink | default .RelPermalink }}">
<img class="thumbnail" src="{{ .RelPermalink }}/thumb.jpg" />
{{ $thumb := $.Page.Resources.GetMatch "thumb.jpg"}}
{{ if $thumb }}
<img class="thumbnail" src="{{ .RelPermalink }}thumb.jpg" />
{{ else }}
<img class="thumbnail" src="/images/thumb.jpg" />
{{ end }}
<div class="description">
<span class="title">{{ .Title }}</span>
<p>{{ .Description }}</p>