perf(assets): reduce HTTP requests to CDN

This commit is contained in:
Cotes Chung
2023-05-13 03:29:06 +08:00
parent 016a9baddd
commit 9d97120197
9 changed files with 167 additions and 139 deletions
-6
View File
@@ -5,7 +5,6 @@
{% assign domain = 'https://cdn.jsdelivr.net/' %}
{% for url in urls %}
{% if url contains domain %}
{% assign url_snippet = url | slice: domain.size, url.size %}
@@ -16,15 +15,10 @@
{% endif %}
{% elsif url contains '//' %}
<script src="{{ url }}"></script>
{% else %}
<script src="{{ url | relative_url }}"></script>
{% endif %}
{% endfor %}
{% if combined_urls %}