From d6d8332165cab7ff9e82e1d9a8914d442556c1c3 Mon Sep 17 00:00:00 2001 From: Jonah Aragon Date: Fri, 14 Feb 2025 12:25:10 -0600 Subject: [PATCH] feat(video): Use video thumbnail for social preview --- theme/layouts/video.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/theme/layouts/video.yml b/theme/layouts/video.yml index e3256aa9..a7e46698 100644 --- a/theme/layouts/video.yml +++ b/theme/layouts/video.yml @@ -21,16 +21,20 @@ definitions: - &logo >- theme/assets/brand/logos/svg/logo/privacy-guides-logo-notext-colorbg.svg + - &thumbnail >- + {%- if page.meta.get("thumbnail") -%} + {{ config.site_url }}{{ page.meta.get("thumbnail") | replace("https://", "assets/external/") }} + {%- else -%} + {{ image.url }} + {%- endif -%} + # Meta tags tags: # Open Graph og:type: video.other og:title: *page_title og:description: *page_description - og:image: "{{ image.url }}" - og:image:type: "{{ image.type }}" - og:image:width: "{{ image.width }}" - og:image:height: "{{ image.height }}" + og:image: *thumbnail og:url: "{{ page.canonical_url }}" # Video @@ -50,7 +54,7 @@ tags: twitter:card: summary_large_image twitter:title: *page_title twitter:description: *page_description - twitter:image: "{{ image.url }}" + twitter:image: *thumbnail # ----------------------------------------------------------------------------- # Specification