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 -->
|
|
|
|
|
2024-05-11 05:29:14 +03:00
|
|
|
{% assign urls = site.data.origin[type].search.js %}
|
2023-03-22 20:29:17 +03:00
|
|
|
|
2021-07-01 11:20:36 +03:00
|
|
|
<!-- layout specified -->
|
|
|
|
|
2023-03-18 01:28:44 +03:00
|
|
|
{% if page.layout == 'post' or page.layout == 'page' or page.layout == 'home' %}
|
2023-09-26 23:44:32 +03:00
|
|
|
{% assign urls = urls | append: ',' | append: site.data.origin[type]['lazy-polyfill'].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: ','
|
2024-04-17 01:10:01 +03:00
|
|
|
| append: site.data.origin[type].glightbox.js
|
2023-03-18 01:28:44 +03:00
|
|
|
| append: ','
|
2023-03-31 01:41:51 +03:00
|
|
|
| append: site.data.origin[type].clipboard.js
|
2023-03-18 01:28:44 +03:00
|
|
|
%}
|
|
|
|
{% 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'
|
|
|
|
%}
|
2024-03-04 22:09:39 +03:00
|
|
|
{% assign locale = include.lang | split: '-' | first %}
|
2022-01-26 17:06:44 +03:00
|
|
|
|
2023-03-22 20:29:17 +03:00
|
|
|
{% assign urls = urls
|
|
|
|
| append: ','
|
2023-03-31 01:41:51 +03:00
|
|
|
| append: site.data.origin[type].dayjs.js.common
|
2023-03-13 15:20:59 +03:00
|
|
|
| append: ','
|
2023-03-31 01:41:51 +03:00
|
|
|
| append: site.data.origin[type].dayjs.js.locale
|
2023-03-13 15:20:59 +03:00
|
|
|
| replace: ':LOCALE', locale
|
|
|
|
| append: ','
|
2023-03-31 01:41:51 +03:00
|
|
|
| append: site.data.origin[type].dayjs.js.relativeTime
|
2023-03-13 15:20:59 +03:00
|
|
|
| append: ','
|
2023-03-31 01:41:51 +03:00
|
|
|
| append: site.data.origin[type].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 %}
|
2023-03-31 01:41:51 +03:00
|
|
|
{% assign urls = urls | append: ',' | append: site.data.origin[type].toc.js %}
|
2022-01-26 17:06:44 +03:00
|
|
|
{% endif %}
|
|
|
|
|
2023-03-22 20:29:17 +03:00
|
|
|
{% if page.mermaid %}
|
2023-03-31 01:41:51 +03:00
|
|
|
{% assign urls = urls | append: ',' | append: site.data.origin[type].mermaid.js %}
|
2023-03-22 20:29:17 +03:00
|
|
|
{% 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-31 01:41:51 +03:00
|
|
|
{% assign js = page.layout %}
|
2023-03-18 01:28:44 +03:00
|
|
|
{% when 'archives', 'category', 'tag' %}
|
2023-03-31 01:41:51 +03:00
|
|
|
{% assign js = 'misc' %}
|
2023-03-13 15:20:59 +03:00
|
|
|
{% else %}
|
2023-03-31 01:41:51 +03:00
|
|
|
{% assign js = 'commons' %}
|
2023-03-13 15:20:59 +03:00
|
|
|
{% endcase %}
|
2020-05-29 19:48:10 +03:00
|
|
|
|
2024-06-05 18:51:10 +03:00
|
|
|
{% capture script %}/assets/js/dist/{{ js }}.min.js{% endcapture %}
|
|
|
|
|
2024-04-28 22:43:33 +03:00
|
|
|
<script 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 -->
|
2024-04-13 23:34:32 +03:00
|
|
|
<script src="{{ '/assets/js/data/mathjax.js' | relative_url }}"></script>
|
2024-03-07 23:05:58 +03:00
|
|
|
<script src="https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js?features=es6"></script>
|
2023-03-31 01:41:51 +03:00
|
|
|
<script id="MathJax-script" async src="{{ site.data.origin[type].mathjax.js | relative_url }}"></script>
|
2020-12-04 09:18:25 +03:00
|
|
|
{% endif %}
|
2021-07-20 20:35:07 +03:00
|
|
|
|
2024-02-25 21:50:41 +03:00
|
|
|
<!-- Pageviews -->
|
|
|
|
{% if page.layout == 'post' %}
|
|
|
|
{% assign provider = site.pageviews.provider %}
|
|
|
|
|
|
|
|
{% if provider and provider != empty %}
|
|
|
|
{% case provider %}
|
|
|
|
{% when 'goatcounter' %}
|
|
|
|
{% if site.analytics[provider].id != empty and site.analytics[provider].id %}
|
|
|
|
{% include pageviews/{{ provider }}.html %}
|
|
|
|
{% endif %}
|
|
|
|
{% endcase %}
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
|
2024-04-28 22:43:33 +03:00
|
|
|
{% if page.mermaid %}
|
|
|
|
{% include mermaid.html %}
|
|
|
|
{% 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 %}
|
2024-06-05 18:51:10 +03:00
|
|
|
<script defer src="{{ 'app.min.js' | relative_url }}"></script>
|
2022-06-04 19:10:20 +03:00
|
|
|
{% endif %}
|
2021-07-20 20:35:07 +03:00
|
|
|
|
2024-02-25 21:50:41 +03:00
|
|
|
<!-- Web Analytics -->
|
|
|
|
{% for analytics in site.analytics %}
|
|
|
|
{% capture str %}{{ analytics }}{% endcapture %}
|
|
|
|
{% assign type = str | split: '{' | first %}
|
|
|
|
{% if site.analytics[type].id and site.analytics[type].id != empty %}
|
|
|
|
{% include analytics/{{ type }}.html %}
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
2021-07-20 20:35:07 +03:00
|
|
|
{% endif %}
|