aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/_includes/common/footer.html
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2021-10-02 17:33:43 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2021-10-02 17:40:29 +0300
commit8a9c0239b65be52f064526b273968c4e2969b758 (patch)
tree6858169e8742277811a14786a9e18ee9733a5dc7 /_includes/common/footer.html
parentREADME: update (diff)
downloadjekyll-theme-8a9c0239b65be52f064526b273968c4e2969b758.tar.gz
jekyll-theme-8a9c0239b65be52f064526b273968c4e2969b758.zip
custom_{css,js}: support absolute URLs
Diffstat (limited to '')
-rw-r--r--_includes/common/footer.html8
1 files changed, 7 insertions, 1 deletions
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 @@
<script src="{{ '/assets/bootstrap/js/bootstrap.min.js' | relative_url }}"></script>
{% if page.custom_js %}
{% for js in page.custom_js %}
- <script src="{{ '/assets/js/' | relative_url }}{{ js }}"></script>
+ {% 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 %}
+ <script src="{{ url }}"></script>
{% endfor %}
{% endif %}
</body>