mirror of
https://github.com/adityatelange/hugo-PaperMod.git
synced 2023-12-21 10:22:58 +01:00
cover: granular controls for hiding cover image #156
in site config => params: cover: hidden: true # hide everywhere but not in structured data hiddenInList: true # hide on list pages and home hiddenInSingle: true # hide on single page per-page in front-matter => hidden: true # only hide on current single page
This commit is contained in:
parent
e252e761f5
commit
c9fa6c7915
@ -31,7 +31,8 @@
|
|||||||
{{- $class = "post-entry tag-entry" }}
|
{{- $class = "post-entry tag-entry" }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
<article class="{{ $class }}">
|
<article class="{{ $class }}">
|
||||||
{{- partial "cover.html" (dict "cxt" . "IsHome" true) }}
|
{{- $isHidden := (.Site.Params.cover.hidden | default .Site.Params.cover.hiddenInList)}}
|
||||||
|
{{- partial "cover.html" (dict "cxt" . "IsHome" true "isHidden" $isHidden) }}
|
||||||
<header class="entry-header">
|
<header class="entry-header">
|
||||||
<h2>
|
<h2>
|
||||||
{{ .Title }}
|
{{ .Title }}
|
||||||
|
@ -28,7 +28,8 @@
|
|||||||
</div>
|
</div>
|
||||||
{{- end}}
|
{{- end}}
|
||||||
</header>
|
</header>
|
||||||
{{- partial "cover.html" (dict "cxt" . "IsHome" false) }}
|
{{- $isHidden := ((.Site.Params.cover.hidden | default .Site.Params.cover.hiddenInSingle) | default .Params.cover.hidden )}}
|
||||||
|
{{- partial "cover.html" (dict "cxt" . "IsHome" false "isHidden" $isHidden) }}
|
||||||
{{- if .Params.ShowToc }}
|
{{- if .Params.ShowToc }}
|
||||||
<div class="toc">
|
<div class="toc">
|
||||||
<details {{if .Params.TocOpen }} open{{ end }}>
|
<details {{if .Params.TocOpen }} open{{ end }}>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{{- with .cxt}} {{/* Apply proper context from dict */}}
|
{{- with .cxt}} {{/* Apply proper context from dict */}}
|
||||||
{{- if .Params.cover.image }}
|
{{- if (and .Params.cover.image (not $.isHidden)) }}
|
||||||
{{- $alt := (.Params.cover.alt | default .Params.cover.caption | plainify) }}
|
{{- $alt := (.Params.cover.alt | default .Params.cover.caption | plainify) }}
|
||||||
<figure class="entry-cover">
|
<figure class="entry-cover">
|
||||||
{{- $addLink := (and .Site.Params.cover.linkFullImages (not $.IsHome)) }}
|
{{- $addLink := (and .Site.Params.cover.linkFullImages (not $.IsHome)) }}
|
||||||
|
Loading…
Reference in New Issue
Block a user