diff options
author | it-gro <grossnik@tuvok> | 2018-08-26 10:24:48 +0300 |
---|---|---|
committer | it-gro <grossnik@tuvok> | 2018-08-26 10:24:48 +0300 |
commit | 1c96ec86eb033f4ab4e88b9e6e959162c820fae3 (patch) | |
tree | ac0c715e6165efd8a1ede85e8e14ed57c86efb4e | |
parent | a091e3fb437ba4ed112c930071d71195804abb37 (diff) |
Fix resource RelPermalink (for HUGO_CANONIFYURLS true-or-false)
-rw-r--r-- | layouts/partials/resource.image.html | 10 |
1 files 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 }} <br/> {{- 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 }} <img class="{{ $theImgClass }}" style="{{ $theImgStyle | safeCSS }}" - src='{{ $myImageRelPermalink | absURL }}' + src='{{ $myImagePermalinkWorkaround }}' alt='{{ $myImage.RelPermalink }}' data-dbg-Site.BaseURL='{{$thePage.Site.BaseURL }}' data-dbg-myBaseUrlSubDirs='{{$myBaseUrlSubDirs }}' - data-dbg-myImageRelPermalink='{{$myImageRelPermalink }}' - data-dbg-myImageRelPermalink-absURL='{{$myImageRelPermalink | absURL }}' + data-dbg-myImagePermalinkWorkaround='{{$myImagePermalinkWorkaround }}' + data-dbg-myImagePermalinkWorkaround-absURL='{{$myImagePermalinkWorkaround | absURL }}' data-dbg-myResource-Permalink='{{$myResource.Permalink }}' data-dbg-myImage-Permalink='{{$myImage.Permalink }}' data-dbg-myImage-Permalink-absURL='{{$myImage.Permalink | absURL }}' |