Skip to content

Commit e1bb61b

Browse files
fix(site): disable PWA manually
1 parent 142644d commit e1bb61b

File tree

1 file changed

+100
-0
lines changed

1 file changed

+100
-0
lines changed

_includes/js-selector.html

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
<!--
2+
JS selector for site.
3+
-->
4+
5+
<!-- layout specified -->
6+
7+
{% if page.layout == 'post' %}
8+
{% if site.google_analytics.pv.proxy_endpoint or site.google_analytics.pv.cache_path %}
9+
<!-- pv-report needs countup.js -->
10+
<script async src="{{ site.data.assets[origin].countup.js }}"></script>
11+
<script defer src="{{ '/assets/js/dist/pvreport.min.js' | relative_url }}"></script>
12+
{% endif %}
13+
{% endif %}
14+
15+
{% if page.layout == 'post' or page.layout == 'page' %}
16+
<!-- image lazy-loading & popup & clipboard -->
17+
{% assign _urls = site.data.assets[origin].magnific-popup.js
18+
| append: ',' | append: site.data.assets[origin].lozad.js
19+
| append: ',' | append: site.data.assets[origin].clipboard.js
20+
%}
21+
22+
{% include jsdelivr-combine.html urls=_urls %}
23+
24+
{% endif %}
25+
26+
{% if page.layout == 'home'
27+
or page.layout == 'post'
28+
or page.layout == 'archives'
29+
or page.layout == 'category'
30+
or page.layout == 'tag' %}
31+
32+
{% if site.prefer_datetime_locale %}
33+
{% assign locale = site.prefer_datetime_locale | downcase %}
34+
{% else %}
35+
{% assign locale = site.lang | split: '-' | first %}
36+
{% endif %}
37+
38+
{% assign _urls = site.data.assets[origin].dayjs.js.common
39+
| append: ',' | append: site.data.assets[origin].dayjs.js.locale
40+
| replace: ':LOCALE', locale
41+
| append: ',' | append: site.data.assets[origin].dayjs.js.relativeTime
42+
| append: ',' | append: site.data.assets[origin].dayjs.js.localizedFormat
43+
%}
44+
45+
{% include jsdelivr-combine.html urls=_urls %}
46+
47+
{% endif %}
48+
49+
{% if page.layout == 'home'
50+
or page.layout == 'categories'
51+
or page.layout == 'post'
52+
or page.layout == 'page' %}
53+
{% assign type = page.layout %}
54+
{% elsif page.layout == 'archives'
55+
or page.layout == 'category'
56+
or page.layout == 'tag' %}
57+
{% assign type = "misc" %}
58+
{% else %}
59+
{% assign type = "commons" %}
60+
{% endif %}
61+
62+
{% capture script %}/assets/js/dist/{{ type }}.min.js{% endcapture %}
63+
<script defer src="{{ script | relative_url }}"></script>
64+
65+
{% if page.math %}
66+
<!-- MathJax -->
67+
<script>
68+
/* see: <https://docs.mathjax.org/en/latest/options/input/tex.html#tex-options> */
69+
MathJax = {
70+
tex: {
71+
inlineMath: [ /* start/end delimiter pairs for in-line math */
72+
['$','$'],
73+
['\\(','\\)']
74+
],
75+
displayMath: [ /* start/end delimiter pairs for display math */
76+
['$$', '$$'],
77+
['\\[', '\\]']
78+
]
79+
}
80+
};
81+
</script>
82+
<script src="{{ site.data.assets[origin].polyfill.js }}"></script>
83+
<script id="MathJax-script" async src="{{ site.data.assets[origin].mathjax.js }}">
84+
</script>
85+
{% endif %}
86+
87+
<!-- commons -->
88+
89+
<script src="{{ site.data.assets[origin].bootstrap.js }}"></script>
90+
91+
{% if jekyll.environment == 'production' %}
92+
<!-- PWA -->
93+
<!-- <script defer src="{{ '/app.js' | relative_url }}"></script> -->
94+
95+
<!-- GA -->
96+
{% if site.google_analytics.id != empty and site.google_analytics.id %}
97+
{% include google-analytics.html %}
98+
{% endif %}
99+
100+
{% endif %}

0 commit comments

Comments
 (0)