diff options
| author | Danilo M. <danix@danix.xyz> | 2026-04-18 20:27:26 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-04-18 20:27:26 +0200 |
| commit | 2ad4993628945be1e58ef08aa63cad82e9655467 (patch) | |
| tree | 00647124af3bf528e3d005cfa37c50ed0b534854 | |
| parent | 41ceb9d034e06275e5bc03a4b02a411ae7000e53 (diff) | |
| download | danixxyz-2ad4993628945be1e58ef08aa63cad82e9655467.tar.gz danixxyz-2ad4993628945be1e58ef08aa63cad82e9655467.zip | |
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 <noreply@anthropic.com>
| -rw-r--r-- | themes/danix-xyz-hacker/layouts/partials/head-meta.html | 6 |
1 files changed, 4 insertions, 2 deletions
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 */}} |
