feat: improve image handling on weekly issue covers

Updated image handling to use Hugo's image processing for resizing cover images, which enhances performance by serving optimized images. Replaces direct image URL with resource-based URL.
This commit is contained in:
Kumi 2024-08-07 08:39:04 +02:00
parent 4e42eff681
commit 86de31fcec
No known key found for this signature in database
GPG key ID: ECBCC9082395383F

View file

@ -10,7 +10,11 @@
<h2><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2> <h2><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2>
<time class="by-line">{{ .Date.Format .Site.Params.dateFormat }}</time> <time class="by-line">{{ .Date.Format .Site.Params.dateFormat }}</time>
<a href="{{ .RelPermalink }}"> <a href="{{ .RelPermalink }}">
<img class="img-lead" src="{{ .RelPermalink }}cover.png" alt="Revuo Monero Weekly #{{ .Params.issuenumber }} cover"> {{ $image := .Resources.Get "cover.png" }}
{{ $image := $image.Resize "650x" }}
{{ with $image }}
<img class="img-lead" src="{{ $image.RelPermalink }}" alt="Revuo Monero Weekly #{{ .Params.issuenumber }} cover">
{{ end }}
</a> </a>
{{ $sTitle := split .Params.title ":" }} {{ $sTitle := split .Params.title ":" }}