Use with for conditional image rendering

This commit is contained in:
ekzyis 2024-04-14 08:14:57 +02:00
parent 8d118ebec3
commit daab1ab16e

@ -2,10 +2,9 @@
<article class="box:border-box"> <article class="box:border-box">
<header class="mb:32"> <header class="mb:32">
<div class="font:40 font:extrabold">{{ .Title }}</div> <div class="font:40 font:extrabold">{{ .Title }}</div>
{{- if isset .Params "banner" -}} {{ with resources.GetMatch .Params.banner }}
{{ $image := resources.Get .Params.banner }} <img class="mt:16" src="{{ .RelPermalink }}" width="{{ .Width }}">
<img class="mt:16" src="{{ $image.RelPermalink }}" width="{{ $image.Width }}"> {{ end }}
{{- end -}}
<div class="mt:16 f:fade-60"> <div class="mt:16 f:fade-60">
{{- if isset .Params "date" -}} {{- if isset .Params "date" -}}
{{ if eq .Lastmod .Date }} {{ if eq .Lastmod .Date }}