web/_includes/js-selector.html

57 lines
1.6 KiB
HTML
Raw Normal View History

<!--
JS selector for site.
-->
2021-01-23 10:07:18 +03:00
{% if page.layout == 'home' or page.layout == 'post' %}
{% if site.google_analytics.pv.proxy_endpoint or site.google_analytics.pv.cache_path %}
2021-01-23 10:07:18 +03:00
<!-- 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 -->
<script>
/* see: <https://docs.mathjax.org/en/latest/options/input/tex.html#tex-options> */
MathJax = {
tex: {
inlineMath: [ /* start/end delimiter pairs for in-line math */
['$','$'],
['\\(','\\)']
],
displayMath: [ /* start/end delimiter pairs for display math */
['$$', '$$'],
['\\[', '\\]']
]
}
};
</script>
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script type="text/javascript" id="MathJax-script" async
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-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 %}