From 2ad4993628945be1e58ef08aa63cad82e9655467 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Sat, 18 Apr 2026 20:27:26 +0200 Subject: refine: use lampD.png only for homepage, default_thumbnail_dark.png for articles - Homepage (IsHome): lampD.png - Articles with image: their custom image - Articles without image: default_thumbnail_dark.png Co-Authored-By: Claude Haiku 4.5 --- themes/danix-xyz-hacker/layouts/partials/head-meta.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'themes') diff --git a/themes/danix-xyz-hacker/layouts/partials/head-meta.html b/themes/danix-xyz-hacker/layouts/partials/head-meta.html index f439bd2..5c6ed8b 100644 --- a/themes/danix-xyz-hacker/layouts/partials/head-meta.html +++ b/themes/danix-xyz-hacker/layouts/partials/head-meta.html @@ -6,8 +6,10 @@ {{ $ogType := "website" }} {{ if and (eq .Kind "page") .Date }}{{ $ogType = "article" }}{{ end }} -{{/* og:image: page image wins; fall back to lamp icon */}} -{{ $ogImage := printf "%s%s" .Site.BaseURL "images/lampD.png" }} +{{/* og:image: page image wins; fall back to lamp for homepage, dark thumbnail for articles */}} +{{ $defaultImage := "images/default_thumbnail_dark.png" }} +{{ if .IsHome }}{{ $defaultImage = "images/lampD.png" }}{{ end }} +{{ $ogImage := printf "%s%s" .Site.BaseURL $defaultImage }} {{ with .Params.image }}{{ $ogImage = printf "%s%s" $.Site.BaseURL (strings.TrimLeft "/" .) }}{{ end }} {{/* author: page-level param wins; fall back to site param */}} -- cgit v1.2.3