2023-03-13 15:20:59 +03:00
|
|
|
<!-- JS selector for site. -->
|
2020-05-29 19:48:10 +03:00
|
|
|
|
2023-03-22 20:29:17 +03:00
|
|
|
<!-- commons -->
|
|
|
|
|
|
|
|
{% assign urls = site.data.assets[origin].jquery.js
|
|
|
|
| append: ','
|
|
|
|
| append: site.data.assets[origin].bootstrap.js
|
|
|
|
| append: ','
|
|
|
|
| append: site.data.assets[origin].search.js
|
|
|
|
%}
|
|
|
|
|
2021-07-01 11:20:36 +03:00
|
|
|
<!-- layout specified -->
|
|
|
|
|
2021-12-03 15:50:12 +03:00
|
|
|
{% if page.layout == 'post' %}
|
2021-04-06 09:05:55 +03:00
|
|
|
{% 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 -->
|
2023-03-22 20:29:17 +03:00
|
|
|
{% assign urls = urls | append: ',' | append: site.data.assets[origin].countup.js %}
|
2021-01-23 10:07:18 +03:00
|
|
|
{% endif %}
|
2020-12-04 09:18:25 +03:00
|
|
|
{% endif %}
|
2020-05-29 19:48:10 +03:00
|
|
|
|
2023-03-18 01:28:44 +03:00
|
|
|
{% if page.layout == 'post' or page.layout == 'page' or page.layout == 'home' %}
|
2023-03-22 20:29:17 +03:00
|
|
|
{% assign urls = urls | append: ',' | append: site.data.assets[origin].lazysizes.js %}
|
2023-03-18 01:28:44 +03:00
|
|
|
|
|
|
|
{% unless page.layout == 'home' %}
|
2023-03-22 20:29:17 +03:00
|
|
|
<!-- image lazy-loading & popup & clipboard -->
|
|
|
|
{% assign urls = urls
|
2023-03-18 01:28:44 +03:00
|
|
|
| append: ','
|
|
|
|
| append: site.data.assets[origin]['magnific-popup'].js
|
|
|
|
| append: ','
|
|
|
|
| append: site.data.assets[origin].clipboard.js
|
|
|
|
%}
|
|
|
|
{% endunless %}
|
2021-04-21 18:17:34 +03:00
|
|
|
{% endif %}
|
|
|
|
|
2021-01-23 10:07:18 +03:00
|
|
|
{% if page.layout == 'home'
|
2023-03-13 15:20:59 +03:00
|
|
|
or page.layout == 'post'
|
|
|
|
or page.layout == 'archives'
|
|
|
|
or page.layout == 'category'
|
|
|
|
or page.layout == 'tag'
|
|
|
|
%}
|
2022-10-18 22:47:48 +03:00
|
|
|
{% assign locale = site.lang | split: '-' | first %}
|
2022-01-26 17:06:44 +03:00
|
|
|
|
2023-03-22 20:29:17 +03:00
|
|
|
{% assign urls = urls
|
|
|
|
| append: ','
|
|
|
|
| append: site.data.assets[origin].dayjs.js.common
|
2023-03-13 15:20:59 +03:00
|
|
|
| append: ','
|
|
|
|
| append: site.data.assets[origin].dayjs.js.locale
|
|
|
|
| replace: ':LOCALE', locale
|
|
|
|
| append: ','
|
|
|
|
| append: site.data.assets[origin].dayjs.js.relativeTime
|
|
|
|
| append: ','
|
|
|
|
| append: site.data.assets[origin].dayjs.js.localizedFormat
|
2022-02-09 17:32:50 +03:00
|
|
|
%}
|
2023-03-22 20:29:17 +03:00
|
|
|
{% endif %}
|
2022-02-09 17:32:50 +03:00
|
|
|
|
2023-03-22 20:29:17 +03:00
|
|
|
{% if page.content contains '<h2' or page.content contains '<h3' and site.toc and page.toc %}
|
|
|
|
{% assign urls = urls | append: ',' | append: site.data.assets[origin].toc.js %}
|
2022-01-26 17:06:44 +03:00
|
|
|
{% endif %}
|
|
|
|
|
2023-03-22 20:29:17 +03:00
|
|
|
{% if page.mermaid %}
|
|
|
|
{% assign urls = urls | append: ',' | append: site.data.assets[origin].mermaid.js %}
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% include jsdelivr-combine.html urls=urls %}
|
|
|
|
|
2023-03-13 15:20:59 +03:00
|
|
|
{% case page.layout %}
|
2023-03-18 01:28:44 +03:00
|
|
|
{% when 'home', 'categories', 'post', 'page' %}
|
2023-03-13 15:20:59 +03:00
|
|
|
{% assign type = page.layout %}
|
2023-03-18 01:28:44 +03:00
|
|
|
{% when 'archives', 'category', 'tag' %}
|
2023-03-13 15:20:59 +03:00
|
|
|
{% assign type = 'misc' %}
|
|
|
|
{% else %}
|
|
|
|
{% assign type = 'commons' %}
|
|
|
|
{% endcase %}
|
2020-05-29 19:48:10 +03:00
|
|
|
|
2022-02-09 17:32:50 +03:00
|
|
|
{% capture script %}/assets/js/dist/{{ type }}.min.js{% endcapture %}
|
|
|
|
<script defer src="{{ script | relative_url }}"></script>
|
2020-05-29 19:48:10 +03:00
|
|
|
|
2020-12-04 09:18:25 +03:00
|
|
|
{% if page.math %}
|
|
|
|
<!-- MathJax -->
|
2021-03-09 10:50:08 +03:00
|
|
|
<script>
|
2023-03-13 15:20:59 +03:00
|
|
|
/* see: <https://docs.mathjax.org/en/latest/options/input/tex.html#tex-options> */
|
|
|
|
MathJax = {
|
|
|
|
tex: {
|
|
|
|
/* start/end delimiter pairs for in-line math */
|
|
|
|
inlineMath: [
|
|
|
|
['$', '$'],
|
|
|
|
['\\(', '\\)']
|
|
|
|
],
|
|
|
|
/* start/end delimiter pairs for display math */
|
|
|
|
displayMath: [
|
|
|
|
['$$', '$$'],
|
|
|
|
['\\[', '\\]']
|
|
|
|
]
|
|
|
|
}
|
|
|
|
};
|
2021-03-09 10:50:08 +03:00
|
|
|
</script>
|
2022-06-02 15:55:34 +03:00
|
|
|
<script src="{{ site.data.assets[origin].polyfill.js | relative_url }}"></script>
|
2023-03-13 15:20:59 +03:00
|
|
|
<script id="MathJax-script" async src="{{ site.data.assets[origin].mathjax.js | relative_url }}"></script>
|
2020-12-04 09:18:25 +03:00
|
|
|
{% endif %}
|
2021-07-20 20:35:07 +03:00
|
|
|
|
|
|
|
{% if jekyll.environment == 'production' %}
|
|
|
|
<!-- PWA -->
|
2022-06-04 19:10:20 +03:00
|
|
|
{% if site.pwa.enabled %}
|
|
|
|
<script defer src="{{ '/app.js' | relative_url }}"></script>
|
|
|
|
{% else %}
|
|
|
|
<script defer src="{{ '/unregister.js' | relative_url }}"></script>
|
|
|
|
{% endif %}
|
2021-07-20 20:35:07 +03:00
|
|
|
|
|
|
|
<!-- GA -->
|
2022-01-14 14:01:22 +03:00
|
|
|
{% 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 %}
|