Skip to content

Commit 9cefe58

Browse files
committed
fix: when the site.img_cdn is set to the local path, the preview-image path loses the baseurl
1 parent b8d1bcd commit 9cefe58

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

_includes/refactor-content.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,11 @@
9292

9393
<!-- Add CDN URL -->
9494
{% if site.img_cdn %}
95-
{% assign _src_prefix = site.img_cdn %}
95+
{% if site.img_cdn contains '//' %}
96+
{% assign _src_prefix = site.img_cdn %}
97+
{% else %}
98+
{% assign _src_prefix = site.img_cdn | relative_url %}
99+
{% endif %}
96100
{% else %}
97101
{% assign _src_prefix = site.baseurl %}
98102
{% endif %}

0 commit comments

Comments
 (0)