-
Notifications
You must be signed in to change notification settings - Fork 418
/
base.html
88 lines (75 loc) · 2.04 KB
/
base.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
{%- extends "!base.html" %}
{#
This template exists as a way to implement a language menu just as what
"Read The Docs" does.
#}
{%- block extrahead %}
{{ super() }}
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-4TMYCGJ0X2"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-4TMYCGJ0X2');
</script>
<!-- Baidu analytics -->
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?da649ade2298891886e31922dfc8870f";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
<!-- MathJax rendering -->
<script>
MathJax = {
tex: {
inlineMath: [ ['$', '$'], ['\\(', '\\)'] ]
},
svg: {
fontCache: 'global'
}
};
</script>
<script
type="text/javascript" id="MathJax-script" async
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js">
</script>
{% endblock %}
{% block body %}
<script>
document.body.dataset.theme = "light";
</script>
{% endblock %}
{% block script %}
{{ super() }}
<script>
function ready(callback) {
if (document.readyState!='loading') {
// in case the document is already rendered
callback();
} else if (document.addEventListener) {
// modern browsers
document.addEventListener('DOMContentLoaded', callback);
} else document.attachEvent('onreadystatechange', function() {
// IE <= 8
if (document.readyState=='complete') {
callback();
}
});
}
ready(function() {
// preload searchindex.js
let scripts = ["{{ pathto('_static/searchtools.js', 1) }}", "{{ pathto('searchindex.js', 1) }}"];
scripts.forEach(src => {
let script = document.createElement("script");
script.src = src;
script.type = "text/javascript";
document.getElementsByTagName("html")[0].appendChild(script);
});
});
</script>
{% endblock %}