mirror of
https://github.com/cotes2020/jekyll-theme-chirpy.git
synced 2025-06-08 00:27:58 +00:00
fix: og:image
will be incorrect if the image uses a cross-domain URL
This commit is contained in:
parent
4b6ccbcbcc
commit
8de1abda6b
@ -24,6 +24,8 @@
|
|||||||
|
|
||||||
{% if page.image %}
|
{% if page.image %}
|
||||||
{% assign img = page.image.path | default: page.image %}
|
{% assign img = page.image.path | default: page.image %}
|
||||||
|
|
||||||
|
{% unless img contains '://' %}
|
||||||
{% assign img_path = page.img_path | append: '/' | append: img | replace: '//', '/' %}
|
{% assign img_path = page.img_path | append: '/' | append: img | replace: '//', '/' %}
|
||||||
{% capture target %}"{{ img | absolute_url }}"{% endcapture %}
|
{% capture target %}"{{ img | absolute_url }}"{% endcapture %}
|
||||||
|
|
||||||
@ -38,6 +40,9 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% assign seo_tags = seo_tags | replace: target, replacement %}
|
{% assign seo_tags = seo_tags | replace: target, replacement %}
|
||||||
|
|
||||||
|
{% endunless %}
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{{ seo_tags }}
|
{{ seo_tags }}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user