From 8a9c0239b65be52f064526b273968c4e2969b758 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sat, 2 Oct 2021 17:33:43 +0300 Subject: custom_{css,js}: support absolute URLs --- _includes/common/footer.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to '_includes/common/footer.html') diff --git a/_includes/common/footer.html b/_includes/common/footer.html index 0e2aecf..0d7a2a0 100644 --- a/_includes/common/footer.html +++ b/_includes/common/footer.html @@ -23,7 +23,13 @@ {% if page.custom_js %} {% for js in page.custom_js %} - + {% assign abs_check = js | downcase | split: '//' %} + {% if abs_check[0] == 'http:' or abs_check[0] == 'https:' or abs_check[0] == blank %} + {% assign url = js %} + {% else %} + {% assign url = '/assets/js/' | relative_url | append: js %} + {% endif %} + {% endfor %} {% endif %} -- cgit v1.2.3