File tree Expand file tree Collapse file tree 1 file changed +18
-13
lines changed
Expand file tree Collapse file tree 1 file changed +18
-13
lines changed Original file line number Diff line number Diff line change 2424
2525 {% if page.image %}
2626 {% assign img = page.image.path | default: page.image %}
27- {% assign img_path = page.img_path | append: '/' | append: img | replace: '//', '/' %}
28- {% capture target %}"{{ img | absolute_url }}"{% endcapture %}
29-
30- {% if site.img_cdn contains '//' %}
31- <!-- it's a cross-origin URL -->
32- {% capture replacement %}"{{ site.img_cdn }}{{ img_path }}"{% endcapture %}
33- {% else %}
34- <!-- it's a local file path -->
35- {%- capture replacement -%}
36- "{{ site.img_cdn | append: '/' | append: img_path | replace: '//', '/' | absolute_url }}"
37- {%- endcapture -%}
38- {% endif %}
3927
40- {% assign seo_tags = seo_tags | replace: target, replacement %}
28+ {% unless img contains '://' %}
29+ {% assign img_path = page.img_path | append: '/' | append: img | replace: '//', '/' %}
30+ {% capture target %}"{{ img | absolute_url }}"{% endcapture %}
31+
32+ {% if site.img_cdn contains '//' %}
33+ <!-- it's a cross-origin URL -->
34+ {% capture replacement %}"{{ site.img_cdn }}{{ img_path }}"{% endcapture %}
35+ {% else %}
36+ <!-- it's a local file path -->
37+ {%- capture replacement -%}
38+ "{{ site.img_cdn | append: '/' | append: img_path | replace: '//', '/' | absolute_url }}"
39+ {%- endcapture -%}
40+ {% endif %}
41+
42+ {% assign seo_tags = seo_tags | replace: target, replacement %}
43+
44+ {% endunless %}
45+
4146 {% endif %}
4247
4348 {{ seo_tags }}
You can’t perform that action at this time.
0 commit comments