Skip to content

Commit 1c8fbb1

Browse files
committed
fix(page): Ensure consistent featured image rendering
Signed-off-by: Khusika Dhamar Gusti <[email protected]>
1 parent 0857365 commit 1c8fbb1

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

layouts/page.html

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,19 @@ <h2 class="single-subtitle animated fadeInDown faster">{{ . }}</h2>
6565
{{- end -}}
6666

6767
{{- /* Featured image */ -}}
68-
{{- $image := $params.featuredimage -}}
69-
{{- with .Resources.GetMatch "featured-image" -}}
70-
{{- $image = .RelPermalink -}}
68+
{{- $image := "" -}}
69+
{{- with .Params.featuredimage | default .Params.featuredImage -}}
70+
{{- $image = . | relURL -}}
71+
{{- else -}}
72+
{{- with .Resources.GetMatch "featured-image" -}}
73+
{{- $image = .RelPermalink -}}
74+
{{- else -}}
75+
{{- range .Params.resources -}}
76+
{{- if eq .name "featured-image" -}}
77+
{{- $image = .src | relURL -}}
78+
{{- end -}}
79+
{{- end -}}
80+
{{- end -}}
7181
{{- end -}}
7282
{{- with $image -}}
7383
<div class="featured-image">

0 commit comments

Comments
 (0)