Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

authorImage does not respect enableImageWebp #993

Open
sit opened this issue Jan 15, 2025 · 0 comments
Open

authorImage does not respect enableImageWebp #993

sit opened this issue Jan 15, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@sit
Copy link

sit commented Jan 15, 2025

Issue description

The profile.html and author.html partials don't pass a webp configuration through to the picture.html partial.

Looks like this can be fixed by doing something like the following in both places:

diff --git a/layouts/partials/profile.html b/layouts/partials/profile.html
index cf0331f2..a59db5ef 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 }}
   <h1 class="text-4xl font-extrabold">

Theme version

stable

Hugo version

0.140.2-extended

Which browser rendering engines are you seeing the problem on?

No response

URL to sample repository or website

No response

Hugo output or build error messages

No response

@sit sit added the bug Something isn't working label Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant