web/_includes/js-selector.html

44 lines
1.2 KiB
HTML
Raw Normal View History

<!--
JS selector for site.
Chirpy v2.3
https://github.com/cotes2020/jekyll-theme-chirpy
© 2020 Cotes Chung
MIT Licensed
-->
2021-01-23 10:07:18 +03:00
{% if page.layout == 'home' or page.layout == 'post' %}
{% if site.google_analytics.pv.enabled %}
<!-- pv-report needs countup.js -->
<script async src="https://cdn.jsdelivr.net/npm/countup.js@1.9.3/dist/countUp.min.js"></script>
<script async src="{{ '/assets/js/dist/pvreport.min.js' | relative_url }}"></script>
{% endif %}
{% endif %}
2021-01-23 10:07:18 +03:00
{% if page.layout == 'home'
or page.layout == 'post'
or page.layout == 'categories' %}
{% assign type = page.layout %}
{% else %}
{% assign type = "page" %}
{% endif %}
2021-01-23 10:07:18 +03:00
{% assign js = type | prepend: '/assets/js/dist/' | append: '.min.js' %}
<script defer src="{{ js | relative_url }}"></script>
{% if page.math %}
<!-- MathJax -->
2020-12-10 14:49:43 +03:00
<script defer src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script defer src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
{% endif %}
{% if jekyll.environment == 'production' %}
<!-- PWA -->
<script defer src="{{ '/app.js' | relative_url }}"></script>
2020-12-10 18:57:00 +03:00
<!-- GA -->
{% if site.google_analytics.id %}
{% include google-analytics.html %}
{% endif %}
{% endif %}