fix(post): correct the image URLs (#1627)
This commit is contained in:
parent
b7aa05d03a
commit
2d649aae0e
1 changed files with 12 additions and 16 deletions
|
@ -17,24 +17,20 @@
|
|||
{%- comment -%} Add page image path prefix {%- endcomment -%}
|
||||
{% assign url = include.img_path | default: '' | append: '/' | append: url %}
|
||||
|
||||
{%- comment -%} CND URL {%- endcomment -%}
|
||||
{%- comment -%} Prepend CND URL {%- endcomment -%}
|
||||
{% if site.img_cdn %}
|
||||
{% assign url = site.img_cdn
|
||||
| append: '/'
|
||||
| append: url
|
||||
| replace: '///', '/'
|
||||
| replace: '//', '/'
|
||||
| replace: ':/', '://'
|
||||
%}
|
||||
{% assign url = site.img_cdn | append: '/' | append: url %}
|
||||
{% endif %}
|
||||
|
||||
{% unless site.img_cdn contains ':' %}
|
||||
{% assign url = url | replace: '///', '/' | replace: '//', '/' | replace: ':/', '://' %}
|
||||
|
||||
{% unless url 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 -%}
|
||||
|
||||
|
|
Loading…
Reference in a new issue