mirror of
https://github.com/adityatelange/hugo-PaperMod.git
synced 2023-12-21 10:22:58 +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 }}">
|
<article class="{{ $class }}">
|
||||||
{{- if .Params.cover.image }}
|
{{- if .Params.cover.image }}
|
||||||
<figure class="entry-cover">
|
<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 }}">
|
<img src="{{ .Params.cover.image | absURL }}" alt="{{ .Params.cover.alt | plainify }}">
|
||||||
{{- else}}
|
{{- else}}
|
||||||
<img src="{{ (path.Join .RelPermalink .Params.cover.image ) | absURL }}" alt="{{ .Params.cover.alt | plainify }}">
|
<img src="{{ (path.Join .RelPermalink .Params.cover.image ) | absURL }}" alt="{{ .Params.cover.alt | plainify }}">
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
</header>
|
</header>
|
||||||
{{- if .Params.cover.image }}
|
{{- if .Params.cover.image }}
|
||||||
<figure class="entry-cover">
|
<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 }}">
|
<img src="{{ .Params.cover.image | absURL }}" alt="{{ .Params.cover.alt | plainify }}">
|
||||||
{{- else}}
|
{{- else}}
|
||||||
<img src="{{ (path.Join .RelPermalink .Params.cover.image ) | absURL }}" alt="{{ .Params.cover.alt | plainify }}">
|
<img src="{{ (path.Join .RelPermalink .Params.cover.image ) | absURL }}" alt="{{ .Params.cover.alt | plainify }}">
|
||||||
|
Loading…
Reference in New Issue
Block a user