web/_includes/js-selector.html

69 lines
2.1 KiB
HTML
Raw Normal View History

<!--
JS selector for site.
-->
2021-07-01 11:20:36 +03:00
<!-- layout specified -->
{% if 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>
2021-07-01 11:20:36 +03:00
<script defer src="{{ '/assets/js/dist/pvreport.min.js' | relative_url }}"></script>
2021-01-23 10:07:18 +03:00
{% endif %}
{% endif %}
2021-04-21 18:17:34 +03:00
{% if page.layout == 'post' or page.layout == 'page' %}
<!-- image lazy-loading & popup -->
2021-09-10 17:01:18 +03:00
<script src="https://cdn.jsdelivr.net/combine/npm/lozad/dist/lozad.min.js,npm/magnific-popup@1/dist/jquery.magnific-popup.min.js,npm/clipboard@2/dist/clipboard.min.js"></script>
2021-04-21 18:17:34 +03:00
{% endif %}
2021-01-23 10:07:18 +03:00
{% if page.layout == 'home'
2021-04-21 18:17:34 +03:00
or page.layout == 'categories'
2021-01-23 10:07:18 +03:00
or page.layout == 'post'
2021-04-21 18:17:34 +03:00
or page.layout == 'page' %}
2021-01-23 10:07:18 +03:00
{% assign type = page.layout %}
{% else %}
2021-04-21 18:17:34 +03:00
{% assign type = "commons" %}
2021-01-23 10:07:18 +03:00
{% 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 %}
2021-07-20 20:35:07 +03:00
<!-- commons -->
<script src="https://cdn.jsdelivr.net/combine/npm/popper.js@1.16.1,npm/bootstrap@4/dist/js/bootstrap.min.js"></script>
{% if jekyll.environment == 'production' %}
<!-- PWA -->
<script defer src="{{ '/app.js' | relative_url }}"></script>
<!-- GA -->
{% if site.google_analytics.id != empty and site.google_analytics.id %}
2021-07-20 20:35:07 +03:00
{% include google-analytics.html %}
{% endif %}
{% endif %}