From 7295940a766416d541ca34629453a24699347365 Mon Sep 17 00:00:00 2001
From: Aditya Telange <21258296+adityatelange@users.noreply.github.com>
Date: Sat, 9 Nov 2024 20:47:29 +0530
Subject: [PATCH] Refactor 4
---
layouts/partials/cover.html | 27 +++++++++++++++------------
1 file changed, 15 insertions(+), 12 deletions(-)
diff --git a/layouts/partials/cover.html b/layouts/partials/cover.html
index 2748c95c..76aaf0d1 100644
--- a/layouts/partials/cover.html
+++ b/layouts/partials/cover.html
@@ -17,26 +17,29 @@
{{- $processableFormats = $processableFormats | append "webp" -}}
{{- end -}}
+ {{- $imgdl := (.Params.cover.image) | absURL }}
+ {{- if $cover -}}
+ {{- $imgdl = $cover.Permalink }}
+ {{- end -}}
+
{{- if $addLink }}
-
+
{{- end }}
{{- if $cover -}}{{/* i.e it is present in page bundle */}}
{{- if (and (in $processableFormats $cover.MediaType.SubType) ($responsiveImages) (eq $prod true)) }}
-
+
{{- else }}{{/* Unprocessable image or responsive images disabled */}}
-
+
{{- end }}
{{- else }}{{/* For absolute urls and external links, no img processing here */}}
- {{- if $addLink }}{{ end -}}
-
+
{{- end }}
{{- if $addLink }}