fix(seo): correct social preview image path inside <meta>
tag (#1623)
This commit is contained in:
parent
cfe44f204b
commit
74cf57aaac
1 changed files with 16 additions and 14 deletions
|
@ -14,24 +14,26 @@
|
||||||
|
|
||||||
{%- if url -%}
|
{%- if url -%}
|
||||||
{% unless url contains ':' %}
|
{% unless url contains ':' %}
|
||||||
{%- comment -%} CND URL {%- endcomment -%}
|
|
||||||
{% assign prefix = site.img_cdn | default: '' %}
|
|
||||||
|
|
||||||
{%- comment -%} Add page image path prefix {%- endcomment -%}
|
{%- comment -%} Add page image path prefix {%- endcomment -%}
|
||||||
{% assign url = include.img_path | default: '' | append: '/' | append: url %}
|
{% assign url = include.img_path | default: '' | append: '/' | append: url %}
|
||||||
|
|
||||||
{% assign url = prefix
|
{%- comment -%} CND URL {%- endcomment -%}
|
||||||
| append: '/'
|
{% if site.img_cdn %}
|
||||||
| append: url
|
{% assign url = site.img_cdn
|
||||||
| replace: '///', '/'
|
| append: '/'
|
||||||
| replace: '//', '/'
|
| append: url
|
||||||
| replace: ':', ':/'
|
| replace: '///', '/'
|
||||||
%}
|
| replace: '//', '/'
|
||||||
|
| replace: ':/', '://'
|
||||||
|
%}
|
||||||
|
|
||||||
{% if include.absolute %}
|
{% unless site.img_cdn contains ':' %}
|
||||||
{% assign url = site.url | append: site.baseurl | append: url %}
|
{% if include.absolute %}
|
||||||
{% else %}
|
{% assign url = site.url | append: site.baseurl | append: url %}
|
||||||
{% assign url = site.baseurl | append: url %}
|
{% else %}
|
||||||
|
{% assign url = site.baseurl | append: url %}
|
||||||
|
{% endif %}
|
||||||
|
{% endunless %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endunless %}
|
{% endunless %}
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
|
|
Loading…
Reference in a new issue