mirror of
https://github.com/cotes2020/jekyll-theme-chirpy.git
synced 2025-06-08 00:27:58 +00:00
Avoid GA snippet blocking HTML parsing.
This commit is contained in:
parent
8d4c1deb15
commit
7d128769f6
@ -8,38 +8,34 @@
|
|||||||
|
|
||||||
{% if page.layout == 'home' %}
|
{% if page.layout == 'home' %}
|
||||||
|
|
||||||
<script src="{{ '/assets/js/home.min.js' | relative_url }}" async></script>
|
<script async src="{{ '/assets/js/home.min.js' | relative_url }}"></script>
|
||||||
|
|
||||||
{% elsif page.layout == 'post' %}
|
{% elsif page.layout == 'post' %}
|
||||||
|
|
||||||
<script src="{{ '/assets/js/post.min.js' | relative_url }}" async></script>
|
<script async src="{{ '/assets/js/post.min.js' | relative_url }}"></script>
|
||||||
|
|
||||||
{% if page.math %}
|
{% if page.math %}
|
||||||
<!-- MathJax -->
|
<!-- MathJax -->
|
||||||
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
|
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js" async></script>
|
<script async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% elsif page.layout == 'page' %}
|
{% elsif page.layout == 'page' %}
|
||||||
|
|
||||||
{% if page.type == 'categories' %}
|
{% if page.type == 'categories' %}
|
||||||
<script src="{{ '/assets/js/categories.min.js' | relative_url }}" async></script>
|
<script async src="{{ '/assets/js/categories.min.js' | relative_url }}"></script>
|
||||||
{% else %}
|
{% else %}
|
||||||
<script src="{{ '/assets/js/page.min.js' | relative_url }}" async></script>
|
<script async src="{{ '/assets/js/page.min.js' | relative_url }}"></script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
||||||
<script src="{{ '/assets/js/page.min.js' | relative_url }}" async></script>
|
<script async src="{{ '/assets/js/page.min.js' | relative_url }}"></script>
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
{% if jekyll.environment == 'production' %}
|
{% if jekyll.environment == 'production' %}
|
||||||
|
|
||||||
{% include google-analytics.html %}
|
|
||||||
|
|
||||||
<!-- PWA -->
|
<!-- PWA -->
|
||||||
<script src="{{ '/app.js' | relative_url }}" defer></script>
|
<script defer src="{{ '/app.js' | relative_url }}"></script>
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -54,6 +54,10 @@ layout: compress
|
|||||||
|
|
||||||
{% include search-loader.html %}
|
{% include search-loader.html %}
|
||||||
|
|
||||||
|
{% if site.google_analytics.id and jekyll.environment == 'production' %}
|
||||||
|
{% include google-analytics.html %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user