From 15e3dedcee1d0830871ffc692143318a87646101 Mon Sep 17 00:00:00 2001 From: Christian Segundo Date: Thu, 25 Jul 2024 02:12:22 +0200 Subject: wip --- .../hugo-PaperMod/layouts/partials/cover.html | 43 ++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 _vendor/github.com/adityatelange/hugo-PaperMod/layouts/partials/cover.html (limited to '_vendor/github.com/adityatelange/hugo-PaperMod/layouts/partials/cover.html') diff --git a/_vendor/github.com/adityatelange/hugo-PaperMod/layouts/partials/cover.html b/_vendor/github.com/adityatelange/hugo-PaperMod/layouts/partials/cover.html new file mode 100644 index 0000000..e92b555 --- /dev/null +++ b/_vendor/github.com/adityatelange/hugo-PaperMod/layouts/partials/cover.html @@ -0,0 +1,43 @@ +{{- 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 $.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)}} + {{- if $cover -}}{{/* i.e it is present in page bundle */}} + {{- if $addLink }}{{ end -}} + {{- $sizes := (slice "360" "480" "720" "1080" "1500") }} + {{- $processableFormats := (slice "jpg" "jpeg" "png" "tif" "bmp" "gif") -}} + {{- if hugo.IsExtended -}} + {{- $processableFormats = $processableFormats | append "webp" -}} + {{- 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 }} + {{- end }} + {{- else }}{{/* For absolute urls and external links, no img processing here */}} + {{- if $addLink }}{{ end -}} + {{ $alt }} + {{- end }} + {{- if $addLink }}{{ end -}} + {{/* Display Caption */}} + {{- if $.IsSingle }} + {{ with .Params.cover.caption }}

{{ . | markdownify }}

{{- end }} + {{- end }} +
+{{- end }}{{/* End image */}} +{{- end -}}{{/* End context */ -}} -- cgit v1.2.3