added option to show image in article preview

This commit is contained in:
Gabriele Musco 2021-03-10 09:25:37 +01:00
parent b2856c86b7
commit f2eba5b387
No known key found for this signature in database
GPG key ID: 8539FD3454380B83
3 changed files with 29 additions and 4 deletions

View file

@ -6,7 +6,7 @@
{{/* pagination */}}
{{ range (.Paginate $postsList).Pages }}
<div class="card {{ if .Site.Params.discreteCards }}discrete{{ end }}">
<article class="card postlistitem {{ if .Site.Params.discreteCards }}discrete{{ end }}">
<h2>
<a href="{{ .Permalink }}">{{ .Title }}</a>
</h2>
@ -21,12 +21,17 @@
{{ end }}
{{ end }}
</p>
{{ if .Site.Params.imageInArticlePreview }}
{{ if .Params.Image }}
<img src="{{ .Params.Image }}" />
{{ end }}
{{end}}
<div class="articlePreview">
{{ .Summary }}
<a href="{{ .Permalink }}">Continue reading </a>
</div>
<hr />
</div>
</article>
{{ end }}
{{- partial "paginator.html" . -}}