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 +++++++- _includes/common/header.html | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) (limited to '_includes') 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 %} diff --git a/_includes/common/header.html b/_includes/common/header.html index 464e42a..f905e37 100644 --- a/_includes/common/header.html +++ b/_includes/common/header.html @@ -23,7 +23,13 @@ {% if page.custom_css %} {% for css in page.custom_css %} - + {% assign abs_check = css | downcase | split: '//' %} + {% if abs_check[0] == 'http:' or abs_check[0] == 'https:' or abs_check[0] == blank %} + {% assign url = css %} + {% else %} + {% assign url = '/assets/css/' | relative_url | append: css %} + {% endif %} + {% endfor %} {% endif %} -- cgit v1.2.3