mirror of
https://github.com/Wonderfall/hugo-WonderMod.git
synced 2024-11-21 18:11:37 +01:00
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 url>'
relative: true
This commit is contained in:
parent
3ca79f59fe
commit
a8abbd3545
@ -33,7 +33,7 @@
|
||||
<article class="{{ $class }}">
|
||||
{{- if .Params.cover.image }}
|
||||
<figure class="entry-cover">
|
||||
{{- 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) }}
|
||||
<img src="{{ .Params.cover.image | absURL }}" alt="{{ .Params.cover.alt | plainify }}">
|
||||
{{- else}}
|
||||
<img src="{{ (path.Join .RelPermalink .Params.cover.image ) | absURL }}" alt="{{ .Params.cover.alt | plainify }}">
|
||||
|
@ -28,7 +28,7 @@
|
||||
</header>
|
||||
{{- if .Params.cover.image }}
|
||||
<figure class="entry-cover">
|
||||
{{- 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) }}
|
||||
<img src="{{ .Params.cover.image | absURL }}" alt="{{ .Params.cover.alt | plainify }}">
|
||||
{{- else}}
|
||||
<img src="{{ (path.Join .RelPermalink .Params.cover.image ) | absURL }}" alt="{{ .Params.cover.alt | plainify }}">
|
||||
|
Loading…
Reference in New Issue
Block a user