mirror of
https://github.com/adityatelange/hugo-PaperMod.git
synced 2024-12-26 23:15:53 -05:00
post-cover: use new format
usage => in page-vars front-matter cover: image: '<image path/url>' alt: '<alt text>'
This commit is contained in:
parent
8cab9c9de5
commit
3068647f58
@ -31,13 +31,13 @@
|
|||||||
{{- $class = "post-entry tag-entry" }}
|
{{- $class = "post-entry tag-entry" }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
<article class="{{ $class }}">
|
<article class="{{ $class }}">
|
||||||
{{- if .Params.cover }}
|
{{- if .Params.cover.image }}
|
||||||
<figure class="entry-cover">
|
<figure class="entry-cover">
|
||||||
{{ if (or (fileExists (path.Join "static" .Params.cover)) (hasPrefix .Params.cover "http://") (hasPrefix .Params.cover "https://")) }}
|
{{- if (or (fileExists (path.Join "static" .Params.cover.image)) (hasPrefix .Params.cover.image "http://") (hasPrefix .Params.cover.image "https://")) }}
|
||||||
<img src="{{ .Params.cover | absURL }}" alt="cover image for {{ .Title | plainify }}">
|
<img src="{{ .Params.cover.image | absURL }}" alt="{{ .Params.cover.alt | plainify }}">
|
||||||
{{else}}
|
{{- else}}
|
||||||
<img src="{{ .Permalink -}} {{- .Params.cover }}" alt="cover image for {{ .Title | plainify }}">
|
<img src="{{ .Permalink -}} {{- .Params.cover.image }}" alt="{{ .Params.cover.alt | plainify }}">
|
||||||
{{end}}
|
{{- end}}
|
||||||
</figure>
|
</figure>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
<header class="entry-header">
|
<header class="entry-header">
|
||||||
|
@ -26,13 +26,13 @@
|
|||||||
</div>
|
</div>
|
||||||
{{- end}}
|
{{- end}}
|
||||||
</header>
|
</header>
|
||||||
{{- if .Params.cover }}
|
{{- if .Params.cover.image }}
|
||||||
<figure class="entry-cover">
|
<figure class="entry-cover">
|
||||||
{{ if (or (fileExists (path.Join "static" .Params.cover)) (hasPrefix .Params.cover "http://") (hasPrefix .Params.cover "https://")) }}
|
{{- if (or (fileExists (path.Join "static" .Params.cover.image)) (hasPrefix .Params.cover.image "http://") (hasPrefix .Params.cover.image "https://")) }}
|
||||||
<img src="{{ .Params.cover | absURL }}" alt="cover image for {{ .Title | plainify }}">
|
<img src="{{ .Params.cover.image | absURL }}" alt="{{ .Params.cover.alt | plainify }}">
|
||||||
{{else}}
|
{{- else}}
|
||||||
<img src="{{ .Permalink -}} {{- .Params.cover }}" alt="cover image for {{ .Title | plainify }}">
|
<img src="{{ .Permalink -}} {{- .Params.cover.image }}" alt="{{ .Params.cover.alt | plainify }}">
|
||||||
{{end}}
|
{{- end}}
|
||||||
</figure>
|
</figure>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Params.ShowToc }}
|
{{- if .Params.ShowToc }}
|
||||||
|
Loading…
Reference in New Issue
Block a user