2022-02-09 17:32:50 +03:00
|
|
|
{% assign urls = include.urls | split: ',' %}
|
|
|
|
|
2024-11-16 17:49:55 +03:00
|
|
|
{% assign combined_urls = null %}
|
2022-02-09 17:32:50 +03:00
|
|
|
|
|
|
|
{% assign domain = 'https://cdn.jsdelivr.net/' %}
|
|
|
|
|
|
|
|
{% for url in urls %}
|
|
|
|
{% if url contains domain %}
|
|
|
|
{% assign url_snippet = url | slice: domain.size, url.size %}
|
|
|
|
|
|
|
|
{% if combined_urls %}
|
|
|
|
{% assign combined_urls = combined_urls | append: ',' | append: url_snippet %}
|
|
|
|
{% else %}
|
|
|
|
{% assign combined_urls = domain | append: 'combine/' | append: url_snippet %}
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% elsif url contains '//' %}
|
2024-11-16 17:49:55 +03:00
|
|
|
<script defer src="{{ url }}"></script>
|
2022-02-09 17:32:50 +03:00
|
|
|
{% else %}
|
2024-11-16 17:49:55 +03:00
|
|
|
<script defer src="{{ url | relative_url }}"></script>
|
2022-02-09 17:32:50 +03:00
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
|
|
|
|
{% if combined_urls %}
|
2024-11-16 17:49:55 +03:00
|
|
|
<script defer src="{{ combined_urls }}"></script>
|
2022-02-09 17:32:50 +03:00
|
|
|
{% endif %}
|