From 381922076fd9a7d9c95ca064895a1b255e1d0d52 Mon Sep 17 00:00:00 2001 From: Kumi Date: Sat, 9 Nov 2024 16:02:35 +0100 Subject: [PATCH] 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 }} + - + + - +