fix: correct image URLs for weekly Twitter and OG tags

Updated the logic for Twitter and Open Graph image tags to use
the correct image URLs for "weekly" section posts. This ensures
that the cover images are correctly displayed on social platforms.
This commit is contained in:
Kumi 2024-07-23 09:47:54 +02:00
parent b5ca26c611
commit 530627ec8f
Signed by: kumi
GPG key ID: ECBCC9082395383F

View file

@ -20,10 +20,10 @@
<meta name="twitter:card" content="summary_large_image" /> <meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="{{ .Title }}" /> <meta name="twitter:title" content="{{ .Title }}" />
<meta name="twitter:image" content="{{ if and (eq .Section "posts") (.Params.image) }}/{{ .Params.image }}{{ else }}/img/revuo-monero.png{{ end }}" /> <meta name="twitter:image" content="{{ if (eq .Section "weekly") }}{{ .Permalink }}/cover.png{{ else }}{{ .Site.BaseURL }}/img/revuo-monero.png{{ end }}" />
<meta property="og:site_name" content="{{ .Site.Title }}" /> <meta property="og:site_name" content="{{ .Site.Title }}" />
<meta property="og:title" content="{{ .Title }}" /> <meta property="og:title" content="{{ .Title }}" />
<meta property="og:image" content="{{ if and (eq .Section "posts") (.Params.image) }}/{{ .Params.image }}{{ else }}/img/revuo-monero.png{{ end }}" /> <meta property="og:image" content="{{ if (eq .Section "weekly") }}{{ .Permalink }}/cover.png{{ else }}{{ .Site.BaseURL }}/img/revuo-monero.png{{ end }}" />
{{ with .OutputFormats.Get "rss" -}} {{ with .OutputFormats.Get "rss" -}}
{{ printf `<link rel=%q type=%q href=%q title=%q>` .Rel .MediaType.Type .Permalink site.Title | safeHTML }} {{ printf `<link rel=%q type=%q href=%q title=%q>` .Rel .MediaType.Type .Permalink site.Title | safeHTML }}