_includes/head.html in jekyll-theme-chirpy-5.3.1 vs _includes/head.html in jekyll-theme-chirpy-5.3.2
- old
+ new
@@ -20,26 +20,25 @@
{% capture seo_tags %}
{% seo title=false %}
{% endcapture %}
- {% if site.img_cdn and seo_tags contains 'og:image' %}
- {% assign properties = 'og:image,twitter:image' | split: ',' %}
+ {% if page.image %}
+ {% assign img = page.image.path | default: page.image %}
+ {% assign img_path = page.img_path | append: '/' | append: img | replace: '//', '/' %}
+ {% capture target %}"{{ img | absolute_url }}"{% endcapture %}
- {% for prop in properties %}
- {% if site.img_cdn contains '//' %}
- <!-- `site.img_cdn` is a cross-origin URL -->
- {% capture target %}<meta property="{{ prop }}" content="{{ site.url }}{% endcapture %}
- {% capture replacement %}<meta property="{{ prop }}" content="{{ site.img_cdn }}{% endcapture %}
- {% else %}
- <!-- `site.img_cdn` is a local file path -->
- {% capture target %}<meta property="{{ prop }}" content="{{ site.url }}{{ site.baseurl }}{% endcapture %}
- {% assign replacement = target | append: site.img_cdn %}
- {% endif %}
+ {% if site.img_cdn contains '//' %}
+ <!-- it's a cross-origin URL -->
+ {% capture replacement %}"{{ site.img_cdn }}{{ img_path }}"{% endcapture %}
+ {% else %}
+ <!-- it's a local file path -->
+ {%- capture replacement -%}
+ "{{ site.img_cdn | append: '/' | append: img_path | replace: '//', '/' | absolute_url }}"
+ {%- endcapture -%}
+ {% endif %}
- {% assign seo_tags = seo_tags | replace: target, replacement %}
-
- {% endfor %}
+ {% assign seo_tags = seo_tags | replace: target, replacement %}
{% endif %}
{{ seo_tags }}
<title>