From a8abbd35452e6a98777e8a618114b0147368d98e Mon Sep 17 00:00:00 2001 From: Aditya Telange <21258296+adityatelange@users.noreply.github.com> Date: Sat, 10 Oct 2020 19:52:08 +0530 Subject: [PATCH] post-cover: relative covers need to be explicitely set * change in d819914 and #13 * previous impl breks sites not using `/static` dir as their static location * hugo supports multiple static directories and previous impl checks only for one * ref : https://gohugo.io/content-management/static-files/ usage change in post-vars => cover: image: '' relative: true --- layouts/_default/list.html | 2 +- layouts/_default/single.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 474d7f76..0b2f0f3c 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -33,7 +33,7 @@
{{- if .Params.cover.image }}
- {{- if (or (fileExists (path.Join "static" .Params.cover.image)) (hasPrefix .Params.cover.image "http://") (hasPrefix .Params.cover.image "https://")) }} + {{- if (ne .Params.cover.relative true) }} {{ .Params.cover.alt | plainify }} {{- else}} {{ .Params.cover.alt | plainify }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index a4c847f5..ef5d6f3e 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -28,7 +28,7 @@ {{- if .Params.cover.image }}
- {{- if (or (fileExists (path.Join "static" .Params.cover.image)) (hasPrefix .Params.cover.image "http://") (hasPrefix .Params.cover.image "https://")) }} + {{- if (ne .Params.cover.relative true) }} {{ .Params.cover.alt | plainify }} {{- else}} {{ .Params.cover.alt | plainify }}