fix: when the site.img_cdn is set to the local path, the preview-image path loses the baseurl

This commit is contained in:
Cotes Chung 2022-03-16 19:49:14 +08:00
parent b8d1bcd3de
commit 9cefe58993
No known key found for this signature in database
GPG key ID: 0D9E54843167A808

View file

@ -92,7 +92,11 @@
<!-- Add CDN URL --> <!-- Add CDN URL -->
{% if site.img_cdn %} {% if site.img_cdn %}
{% if site.img_cdn contains '//' %}
{% assign _src_prefix = site.img_cdn %} {% assign _src_prefix = site.img_cdn %}
{% else %}
{% assign _src_prefix = site.img_cdn | relative_url %}
{% endif %}
{% else %} {% else %}
{% assign _src_prefix = site.baseurl %} {% assign _src_prefix = site.baseurl %}
{% endif %} {% endif %}