show thumbnail in the card only when it is set

This commit is contained in:
Nishant Srivastava 2020-01-20 19:40:47 +01:00
parent 352b889eae
commit 0df3f2ecbe
1 changed files with 2 additions and 0 deletions

View File

@ -15,9 +15,11 @@
<a href="{{ .Params.Link }}" class="showcase__box--title" target="_blank" rel="noreferrer"> <a href="{{ .Params.Link }}" class="showcase__box--title" target="_blank" rel="noreferrer">
{{ .Title }} {{ .Title }}
</a> </a>
{{ if (isset .Params "thumb") | or (eq .Params.thumb "") }}
<a href="{{ .Params.Link }}" class="showcase__box--img" target="_blank" rel="noreferrer"> <a href="{{ .Params.Link }}" class="showcase__box--img" target="_blank" rel="noreferrer">
<img src="{{ (print "images/" .Params.thumb) | relURL }}" alt="{{ .Title }}"> <img src="{{ (print "images/" .Params.thumb) | relURL }}" alt="{{ .Title }}">
</a> </a>
{{ end }}
<div class="showcase__box--desc"> <div class="showcase__box--desc">
{{ .Description }} {{ .Description }}
</div> </div>