From b8d1bcd3dea0abd1afef7ef154a4501fbb18938d Mon Sep 17 00:00:00 2001 From: Cotes Chung <11371340+cotes2020@users.noreply.github.com> Date: Wed, 16 Mar 2022 19:43:23 +0800 Subject: [PATCH] fix: resume the preview image SEO tag (#529) Fix #529 --- _includes/head.html | 25 ++++++++++++++++++++++++- _layouts/post.html | 4 ++-- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/_includes/head.html b/_includes/head.html index 50e0214..948c4f8 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -23,7 +23,30 @@ {% endif %} - {% seo title=false %} + {% capture seo_tags %} + {% seo title=false %} + {% endcapture %} + + {% if site.img_cdn and seo_tags contains 'og:image' %} + {% assign properties = 'og:image,twitter:image' | split: ',' %} + + {% for prop in properties %} + {% if site.img_cdn contains '//' %} + + {% capture target %}