From 9cefe58993d9ea3a3a28424e7ffd8e0911567c5c Mon Sep 17 00:00:00 2001 From: Cotes Chung <11371340+cotes2020@users.noreply.github.com> Date: Wed, 16 Mar 2022 19:49:14 +0800 Subject: [PATCH] fix: when the `site.img_cdn` is set to the local path, the preview-image path loses the `baseurl` --- _includes/refactor-content.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/_includes/refactor-content.html b/_includes/refactor-content.html index 6db8923..dd09205 100644 --- a/_includes/refactor-content.html +++ b/_includes/refactor-content.html @@ -92,7 +92,11 @@ {% if site.img_cdn %} - {% assign _src_prefix = site.img_cdn %} + {% if site.img_cdn contains '//' %} + {% assign _src_prefix = site.img_cdn %} + {% else %} + {% assign _src_prefix = site.img_cdn | relative_url %} + {% endif %} {% else %} {% assign _src_prefix = site.baseurl %} {% endif %}