commit 8b28b06e725cba09deded07a6bd5e5c7d047fac2
parent 3a101141d0e04fa95032416462300e0d8ebe938e
Author: panr <radoslaw.koziel@gmail.com>
Date:   Sun,  6 Nov 2022 10:31:25 +0100

Fix cover param for og:image

Diffstat:
Mlayouts/partials/head.html | 12++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/layouts/partials/head.html b/layouts/partials/head.html @@ -52,8 +52,12 @@ <meta property="og:description" content="{{ if .IsHome }}{{ $.Site.Params.Subtitle }}{{ else if .Description}}{{ .Description | plainify }}{{ else }}{{ .Summary | plainify }}{{ end }}" /> <meta property="og:url" content="{{ .Permalink }}" /> <meta property="og:site_name" content="{{ $.Site.Title }}" /> -{{ if and (not .IsHome) (isset .Params "cover") }} - <meta property="og:image" content="{{ .Param "cover" | absURL }}"> +{{ if (isset .Params "cover") }} + {{ $pageCover := .Param "cover" }} + {{ with (.Resources.GetMatch (.Param "cover")) }} + {{ $pageCover = .RelPermalink }} + {{ end }} + <meta property="og:image" content="{{ $pageCover | absURL }}"> {{ else }} {{ if isset $.Site.Params "favicon" }} <meta property="og:image" content="{{ $.Site.Params.favicon | absURL }}"> @@ -61,8 +65,8 @@ <meta property="og:image" content="{{ printf "img/favicon/%s.png" $.Site.Params.ThemeColor | absURL }}"> {{ end }} {{ end }} -<meta property="og:image:width" content="2048"> -<meta property="og:image:height" content="1024"> +<meta property="og:image:width" content="1200"> +<meta property="og:image:height" content="627"> {{ range .Params.categories }} <meta property="article:section" content="{{ . }}" /> {{ end }}