From 2fec7c0c979938b53c2b6d4b0d2aa2382f29b062 Mon Sep 17 00:00:00 2001 From: James Panther <4462786+jpanther@users.noreply.github.com> Date: Mon, 24 Feb 2025 13:28:44 +1100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Ensure=20profile=20partial=20gen?= =?UTF-8?q?erates=20WebP=20images=20where=20requested?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: #993 --- CHANGELOG.md | 1 + layouts/partials/profile.html | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eecf7d9..8c670d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ### Fixed - Incorrect links generated for translated content when site is in multi-host mode ([#990](https://github.com/jpanther/congo/pull/990)) +- Profile partial does not generate WebP versions of the author image ([#993](https://github.com/jpanther/congo/issues/993)) - Vendor script includes do not use the `fingerprintAlgorithm` site parameter ([#1015](https://github.com/jpanther/congo/issues/1015)) - Minor documentation errors and omissions ([#985](https://github.com/jpanther/congo/pull/985), [#1005](https://github.com/jpanther/congo/pull/1005), [#1007](https://github.com/jpanther/congo/pull/1007), [#1012](https://github.com/jpanther/congo/pull/1012)) - References to deprecated `twitter` shortcodes and replaced them with `x` diff --git a/layouts/partials/profile.html b/layouts/partials/profile.html index cf0331f..a59db5e 100644 --- a/layouts/partials/profile.html +++ b/layouts/partials/profile.html @@ -14,7 +14,8 @@ {{ $authorImage := resources.Get . }} {{ if $authorImage }} {{ $imgClass := "mb-2 h-auto w-36 rounded-full" }} - {{ partial "picture.html" (dict "img" $authorImage "alt" $altText "class" $imgClass "lazy" $lazy) }} + {{ $webp := $.Page.Site.Params.enableImageWebp | default true }} + {{ partial "picture.html" (dict "img" $authorImage "alt" $altText "class" $imgClass "lazy" $lazy "webp" $webp) }} {{ end }} {{ end }}