From: XhmikosR Date: Sun, 25 Dec 2022 16:14:27 +0000 (+0200) Subject: docs: improve social image partial (#37717) X-Git-Tag: v5.3.0-alpha2~226 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=b613cfb58bf4b3c2acc8f46f661f1814744620da;p=thirdparty%2Fbootstrap.git docs: improve social image partial (#37717) * Fix social image URL to be absolute * Deduplicate social.html * Get image dimensions with Hugo --- diff --git a/site/layouts/partials/social.html b/site/layouts/partials/social.html index 2226c386c4..f4f556e5a8 100644 --- a/site/layouts/partials/social.html +++ b/site/layouts/partials/social.html @@ -1,15 +1,27 @@ +{{- $pageTitle := .Title | markdownify -}} +{{- $pageDescription := .Page.Params.description | default .Site.Params.description | markdownify -}} +{{- $socialImagePath := printf "/docs/%s/assets" .Site.Params.docs_version -}} + +{{- if .Page.Params.thumbnail -}} + {{- $socialImagePath = path.Join $socialImagePath "img/" .Page.Params.thumbnail -}} +{{- else -}} + {{- $socialImagePath = path.Join $socialImagePath "brand/bootstrap-social.png" -}} +{{- end -}} + - - - + + + - - + + + - - - +{{ with (imageConfig (path.Join "site/static" $socialImagePath)) -}} + + +{{- end }}