From 48cd01768bd81c857162ac3dd70c523ac2c19c23 Mon Sep 17 00:00:00 2001 From: Christoph Cullmann Date: Sun, 14 Apr 2024 19:30:41 +0200 Subject: sync theme --- themes/PaperMod/layouts/partials/cover.html | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'themes/PaperMod/layouts/partials/cover.html') diff --git a/themes/PaperMod/layouts/partials/cover.html b/themes/PaperMod/layouts/partials/cover.html index 0f8bfbc..e92b555 100644 --- a/themes/PaperMod/layouts/partials/cover.html +++ b/themes/PaperMod/layouts/partials/cover.html @@ -1,9 +1,10 @@ {{- with .cxt}} {{/* Apply proper context from dict */}} {{- if (and .Params.cover.image (not $.isHidden)) }} {{- $alt := (.Params.cover.alt | default .Params.cover.caption | plainify) }} +{{- $loading := cond $.IsSingle "eager" "lazy" }}
{{- $responsiveImages := (.Params.cover.responsiveImages | default site.Params.cover.responsiveImages) | default true }} - {{- $addLink := (and site.Params.cover.linkFullImages (not $.IsHome)) }} + {{- $addLink := (and site.Params.cover.linkFullImages $.IsSingle) }} {{- $pageBundleCover := (.Resources.ByType "image").GetMatch (printf "*%s*" (.Params.cover.image)) }} {{- $globalResourcesCover := (resources.ByType "image").GetMatch (printf "*%s*" (.Params.cover.image)) }} {{- $cover := (or $pageBundleCover $globalResourcesCover)}} @@ -17,7 +18,7 @@ {{- end -}} {{- $prod := (hugo.IsProduction | or (eq site.Params.env "production")) }} {{- if (and (in $processableFormats $cover.MediaType.SubType) ($responsiveImages) (eq $prod true)) }} - {{ $alt }} {{- else }}{{/* Unprocessable image or responsive images disabled */}} - {{ $alt }} + {{ $alt }} {{- end }} {{- else }}{{/* For absolute urls and external links, no img processing here */}} {{- if $addLink }}{{ end -}} - {{ $alt }} + {{ $alt }} {{- end }} {{- if $addLink }}{{ end -}} {{/* Display Caption */}} - {{- if not $.IsHome }} + {{- if $.IsSingle }} {{ with .Params.cover.caption }}

{{ . | markdownify }}

{{- end }} {{- end }}
-- cgit v1.2.3