From da105625ffe85d96bebb1f90f19e5da703b709f1 Mon Sep 17 00:00:00 2001 From: sixpointcube Date: Wed, 19 Jun 2024 10:47:17 -0400 Subject: [PATCH] feat: convert images to png --- layouts/partials/func/GetFeaturedImage.html | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/layouts/partials/func/GetFeaturedImage.html b/layouts/partials/func/GetFeaturedImage.html index 8d250c7..3cea9b1 100644 --- a/layouts/partials/func/GetFeaturedImage.html +++ b/layouts/partials/func/GetFeaturedImage.html @@ -20,9 +20,12 @@ {{ $matches := "feature,cover" }} {{/* Use the value from front matter if present */}} {{ with .Params.featured_image }} - {{/* This is the default case, the image lives in the static directory. - In which case we'll use the static dir */}} - {{ $linkToCover = trim . "/" | absURL }} +{{ $original := resources.Get . }} +{{ with $original }} + {{ $processed := .Process "webp" }} + {{ $linkToCover = $processed.RelPermalink }} +{{ end }} + {{/* If we find a Page Resource matching the exact value, we use it instead. */}} {{ with $.Resources.GetMatch . }} {{ $linkToCover = .RelPermalink }}