Joris Conijn f9595c791a feat: show featured image in summary (when available)
Display the feature image as a preview when displaying a list of pages.
2023-09-15 18:29:39 +02:00

20 lines
766 B
HTML

{{ $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 }}
</a>
</h1>
<div class="nested-links f5 lh-copy nested-copy-line-height">
{{ .Summary }}
</div>
</div>
</div>