1
0
mirror of https://github.com/cotes2020/jekyll-theme-chirpy.git synced 2025-12-18 13:44:15 +00:00

fix: og:image will be incorrect if the image uses a cross-domain URL

This commit is contained in:
Cotes Chung
2022-12-15 22:55:52 +08:00
parent 4b6ccbcbcc
commit 8de1abda6b

View File

@@ -24,6 +24,8 @@
{% if page.image %}
{% assign img = page.image.path | default: page.image %}
{% unless img contains '://' %}
{% assign img_path = page.img_path | append: '/' | append: img | replace: '//', '/' %}
{% capture target %}"{{ img | absolute_url }}"{% endcapture %}
@@ -38,6 +40,9 @@
{% endif %}
{% assign seo_tags = seo_tags | replace: target, replacement %}
{% endunless %}
{% endif %}
{{ seo_tags }}