From bd8e34a38144ac770846604becdfd5ecb7eebc06 Mon Sep 17 00:00:00 2001 From: BBaoVanC Date: Sat, 9 Aug 2025 02:53:46 -0500 Subject: [PATCH] Support opengraph structured properties on image and video --- layouts/_partials/seo-tags/opengraph.html | 36 ++++++++++++++++------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/layouts/_partials/seo-tags/opengraph.html b/layouts/_partials/seo-tags/opengraph.html index 54da2cd..a719ecc 100644 --- a/layouts/_partials/seo-tags/opengraph.html +++ b/layouts/_partials/seo-tags/opengraph.html @@ -3,16 +3,6 @@ -{{ $images := $.Resources.ByType "image" }} -{{ $featured := $images.GetMatch "*feature*" }} -{{ if not $featured }} - {{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }} -{{ end }} - -{{ with $featured }} - -{{ end }} - {{ with .Section }} {{ end }} @@ -37,12 +27,38 @@ {{ end }} +{{ $images := $.Resources.ByType "image" }} +{{ $featured := $images.GetMatch "*feature*" }} +{{ if not $featured }} + {{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }} +{{ end }} + +{{ with $featured }} + + {{ with .Params.alt }} + + {{ end }} + {{ with .MediaType }} + + {{ end }} + {{ with .Width }} + + {{ end }} + {{ with .Height }} + + {{ end }} +{{ end }} + {{ $videos := $.Resources.ByType "video" }} {{ $featured_video := $videos.GetMatch "*feature*" }} {{ if not $featured_video }} {{ $featured_video = $videos.GetMatch "{*cover*,*thumbnail*}" }} {{ end }} + {{ with $featured_video }} + {{ with .MediaType }} + + {{ end }} {{ end }}