Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve scripts performance by loading them asynchronously #120

Open
skalee opened this issue Jul 6, 2020 · 0 comments
Open

Improve scripts performance by loading them asynchronously #120

skalee opened this issue Jul 6, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@skalee
Copy link
Contributor

skalee commented Jul 6, 2020

Scripts are referenced at the end of page's <body> and loaded synchronously.

{% include script.html %}
{% if site.geolexica.math %}
{%- include math-config.html -%}
{% endif %}
<template id="expandableNavTrigger">
<button class="nav-expand-trigger">
<i class="fas fa-bars"></i>
<i class="fas fa-times"></i>
</button>
</template>
<script src="{{ "/assets/js/nav.js" | relative_url }}"></script>
{% assign extra_scripts = page.extra_scripts | default: layout.extra_scripts %}
{% if extra_scripts %}
{% for sc in extra_scripts %}
<script
src="{{ sc.src }}"
{% if sc.integrity %}integrity="{{ sc.integrity }}"{% endif %}
{% if sc.crossorigin %}crossorigin="{{ sc.crossorigin }}"{% endif %}></script>
{% endfor %}
{% endif %}

This hampers performance.

@skalee skalee added the enhancement New feature or request label Jul 6, 2020
@ronaldtse ronaldtse moved this to 🆕 New in Geolexica Jul 24, 2022
@ronaldtse ronaldtse moved this from 🆕 New to 📋 Backlog in Geolexica Jul 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant