feat: show featured image in summary (when available)

Display the feature image as a preview when displaying a list of pages.
This commit is contained in:
Joris Conijn 2023-09-15 18:29:39 +02:00
parent a1a99cf126
commit f9595c791a

View File

@ -1,6 +1,12 @@
{{ $featured_image := partial "func/GetFeaturedImage.html" . }}
<div class="relative w-100 mb4 bg-white nested-copy-line-height">
<div class="bg-white mb3 pa4 gray overflow-hidden">
{{with .CurrentSection.Title }}<span class="f6 db">{{ . }}</span>{{end}}
{{ if $featured_image }}
<a href="{{ .RelPermalink }}" class="link black dim">
<div class="featured_image" style="background: url(&quot;{{ $featured_image }}&quot;) center center / cover no-repeat; height: 200px;"></div>
</a>
{{ end }}
<h1 class="f3 near-black">
<a href="{{ .RelPermalink }}" class="link black dim">
{{ .Title }}