From 381922076fd9a7d9c95ca064895a1b255e1d0d52 Mon Sep 17 00:00:00 2001 From: Kumi Date: Sat, 9 Nov 2024 16:02:35 +0100 Subject: [PATCH 1/2] fix: ensure default image for og and twitter cards Updated the HTML partial to use a default image when `.Params.image` is undefined, improving robustness of Open Graph and Twitter card metadata. This ensures consistent presentation of content across social media, preventing missing image issues when a custom image is not provided. --- layouts/partials/head.html | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/layouts/partials/head.html b/layouts/partials/head.html index f2d6641..8e623c4 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -7,14 +7,22 @@ {{ $style := resources.Get "css/style.css" }} {{ $css := $style | minify | fingerprint }} - + + {{ $image := "" }} + {{ if .Params.image }} + {{ $image = .Params.image }} + {{ else }} + {{ $image = resources.Get "images/profile.jpg" }} + {{ end }} + - + + - + From 2d5627f744c6dbaccd309d1609dacfda1e4fbbaa Mon Sep 17 00:00:00 2001 From: Kumi Date: Sat, 9 Nov 2024 17:24:06 +0100 Subject: [PATCH 2/2] fix(head.html): update default profile image path Updated the default profile image path to reflect changes in file naming conventions or image updates. This ensures the site uses the latest image version as intended in situations where no specific image is defined in the parameters. --- layouts/partials/head.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 8e623c4..87a70d9 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -12,7 +12,7 @@ {{ if .Params.image }} {{ $image = .Params.image }} {{ else }} - {{ $image = resources.Get "images/profile.jpg" }} + {{ $image = resources.Get "images/rw_profile.jpg" }} {{ end }}