File tree Expand file tree Collapse file tree 1 file changed +14
-16
lines changed
Expand file tree Collapse file tree 1 file changed +14
-16
lines changed Original file line number Diff line number Diff line change 2222 {% seo title=false %}
2323 {% endcapture %}
2424
25- {% if site.img_cdn and seo_tags contains 'og:image' %}
26- {% assign properties = 'og:image,twitter:image' | split: ',' %}
27-
28- {% for prop in properties %}
29- {% if site.img_cdn contains '//' %}
30- <!-- `site.img_cdn` is a cross-origin URL -->
31- {% capture target %}< meta property ="{{ prop }} " content ="{{ site.url }}{% endcapture %}
32- {% capture replacement %}<meta property= "{{ prop }} " content="{{ site.img_cdn }}{% endcapture %}
33- {% else %}
34- <!-- `site.img_cdn` is a local file path -->
35- {% capture target %}<meta property= "{{ prop }} " content="{{ site.url }}{{ site.baseurl }}{% endcapture %}
36- {% assign replacement = target | append: site.img_cdn %}
37- {% endif %}
38-
39- {% assign seo_tags = seo_tags | replace: target, replacement %}
25+ {% if page.image.path %}
26+ {% capture target %}"{{ site.url }}{{ page.image.path | relative_url }}"{% endcapture %}
27+
28+ {% if site.img_cdn contains '//' %}
29+ <!-- it's a cross-origin URL -->
30+ {% capture replacement %}"{{ site.img_cdn }}{{ page.img_path }}{{ page.image.path }}"{% endcapture %}
31+ {% else %}
32+ <!-- it's a local file path -->
33+ {%- capture replacement -%}
34+ "{{ site.url }}{{ site.baseurl }}{{ site.img_cdn }}{{ page.img_path }}{{ page.image.path }}"
35+ {%- endcapture -%}
36+ {% endif %}
37+
38+ {% assign seo_tags = seo_tags | replace: target, replacement %}
4039
41- {% endfor %}
4240 {% endif %}
4341
4442 {{ seo_tags }}
You can’t perform that action at this time.
0 commit comments