From cfe44f204bcec8e05f498512ec50878e626a124f Mon Sep 17 00:00:00 2001 From: Alexander Fuks Date: Fri, 22 Mar 2024 22:56:19 +0400 Subject: [PATCH 1/2] fix: correct the attribute for the Twitter social image (#1615) --- _includes/head.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_includes/head.html b/_includes/head.html index 9bad78a..c9187a3 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -39,7 +39,7 @@ {%- endcapture -%} {%- capture twitter_image -%} - + {%- endcapture -%} From 74cf57aaacf6674057e6f33240a22f4888cfe88f Mon Sep 17 00:00:00 2001 From: Cotes Chung <11371340+cotes2020@users.noreply.github.com> Date: Sat, 23 Mar 2024 03:32:03 +0800 Subject: [PATCH 2/2] fix(seo): correct social preview image path inside `` tag (#1623) --- _includes/img-url.html | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/_includes/img-url.html b/_includes/img-url.html index 2f8d401..20620b7 100644 --- a/_includes/img-url.html +++ b/_includes/img-url.html @@ -14,24 +14,26 @@ {%- if url -%} {% unless url contains ':' %} - {%- comment -%} CND URL {%- endcomment -%} - {% assign prefix = site.img_cdn | default: '' %} - {%- comment -%} Add page image path prefix {%- endcomment -%} {% assign url = include.img_path | default: '' | append: '/' | append: url %} - {% assign url = prefix - | append: '/' - | append: url - | replace: '///', '/' - | replace: '//', '/' - | replace: ':', ':/' - %} + {%- comment -%} CND URL {%- endcomment -%} + {% if site.img_cdn %} + {% assign url = site.img_cdn + | append: '/' + | append: url + | replace: '///', '/' + | replace: '//', '/' + | replace: ':/', '://' + %} - {% if include.absolute %} - {% assign url = site.url | append: site.baseurl | append: url %} - {% else %} - {% assign url = site.baseurl | append: url %} + {% unless site.img_cdn contains ':' %} + {% if include.absolute %} + {% assign url = site.url | append: site.baseurl | append: url %} + {% else %} + {% assign url = site.baseurl | append: url %} + {% endif %} + {% endunless %} {% endif %} {% endunless %} {%- endif -%}