From 470ea40982f5036554819253c3ac6ed4a34193f4 Mon Sep 17 00:00:00 2001
From: Regis Philibert <login@regisphilibert.com>
Date: Fri, 10 Jun 2022 19:36:57 +0000
Subject: [PATCH] Only apply the absURL on images served through satic directory (#557)

---
 layouts/partials/func/GetFeaturedImage.html |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/layouts/partials/func/GetFeaturedImage.html b/layouts/partials/func/GetFeaturedImage.html
index 12ffe1c..8d250c7 100644
--- a/layouts/partials/func/GetFeaturedImage.html
+++ b/layouts/partials/func/GetFeaturedImage.html
@@ -20,7 +20,9 @@
 {{ $matches := "feature,cover" }}
 {{/* Use the value from front matter if present */}}
 {{ with .Params.featured_image }}
-	{{ $linkToCover = . }}
+  {{/* This is the default case, the image lives in the static directory.
+    In which case we'll use the static dir */}}
+  {{ $linkToCover = trim . "/" | absURL }}
   {{/* If we find a Page Resource matching the exact value, we use it instead. */}}
   {{ with $.Resources.GetMatch . }}
     {{ $linkToCover = .RelPermalink }}

--
Gitblit v1.10.0