Make scripts defered for (potential) load time boost

This commit is contained in:
daudix
2024-09-28 02:41:11 +03:00
parent 42c78c8557
commit 72389f8b6d
4 changed files with 83 additions and 83 deletions

View File

@ -104,7 +104,7 @@
{%- if scripts | length > 0 %}
{%- for script in scripts %}
<script type="text/javascript" {% if script == "count.js" %}data-goatcounter="https://{{ config.extra.goatcounter.user }}.{{ config.extra.goatcounter.host | default(value='goatcounter.com') }}/count"{% endif %} src="{{ get_url(path=script) | safe }}"></script>
<script type="text/javascript" defer {% if script == "count.js" %}data-goatcounter="https://{{ config.extra.goatcounter.user }}.{{ config.extra.goatcounter.host | default(value='goatcounter.com') }}/count"{% endif %} src="{{ get_url(path=script) | safe }}"></script>
{%- endfor %}
{%- endif %}