From 1c96ec86eb033f4ab4e88b9e6e959162c820fae3 Mon Sep 17 00:00:00 2001 From: it-gro Date: Sun, 26 Aug 2018 09:24:48 +0200 Subject: Fix resource RelPermalink (for HUGO_CANONIFYURLS true-or-false) --- layouts/partials/resource.image.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/layouts/partials/resource.image.html b/layouts/partials/resource.image.html index fa1cce3..97608be 100644 --- a/layouts/partials/resource.image.html +++ b/layouts/partials/resource.image.html @@ -69,18 +69,18 @@ theResImgOpt : {{- $theResImgOpt }}
{{- if $myImage }} {{- $myBaseUrlSubDirs := replaceRE `^(http(s)?)?://(.*?)/` `` $thePage.Site.BaseURL }} {{- if not (findRE (printf "^/%s" $myBaseUrlSubDirs) $myImage.RelPermalink) }} - {{- $thePage.Scratch.Set `myImageRelPermalink` (printf "%s/%s" $myBaseUrlSubDirs $myImage.RelPermalink ) }} + {{- $thePage.Scratch.Set `myImagePermalinkWorkaround` (printf "/%s/%s" $myBaseUrlSubDirs $myImage.RelPermalink ) }} {{- end }} - {{- $myImageRelPermalink := ($thePage.Scratch.Get `myImageRelPermalink`) | default $myImage.RelPermalink }} + {{- $myImagePermalinkWorkaround := ($thePage.Scratch.Get `myImagePermalinkWorkaround`) | default $myImage.RelPermalink }}