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
No known key found for this signature in database
GPG key ID: 0D9E54843167A808

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 }}