github.com/e154/smart-home@v0.17.2-0.20240311175135-e530a6e5cd45/doc/themes/docsy/layouts/partials/featured-image.html (about) 1 {{ $w := .w | default 480 }} 2 {{ $h := .h | default 180 }} 3 {{ $p := .p }} 4 {{ $class := .class | default "ml-3" }} 5 {{ $image := ($p.Resources.ByType "image").GetMatch "**featured*" }} 6 {{ with $image }} 7 {{ $image := .Fill (printf "%dx%d" $w $h ) }} 8 <figure class="{{ $class }}" style="width: {{ $image.Width }}px"> 9 <img src="{{ $image.RelPermalink }}" alt="Featured Image for {{ $p.Title }}" width="{{ $image.Width }}" height="{{ $image.Height }}"> 10 {{ with $image.Params.byline }} 11 <figcaption class="mt-2 mt-md-0"><small class="text-muted">{{ . | html }}</small></figcaption> 12 {{ end }} 13 </figure> 14 {{ end }}