Skip to content

Commit f8cc776

Browse files
committed
2020-11-23 13:31:04
1 parent d8461bc commit f8cc776

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

asset/docsify-baidu-stat.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
(function(){
2+
var plugin = function(hook) {
3+
hook.doneEach(function() {
4+
window._hmt = window._hmt || []
5+
var hm = document.createElement("script")
6+
hm.src = "https://hm.baidu.com/hm.js?" + window.$docsify.bdStatId
7+
document.querySelector("article").appendChild(hm)
8+
})
9+
}
10+
var plugins = window.$docsify.plugins || []
11+
plugins.push(plugin)
12+
window.$docsify.plugins = plugins
13+
})()

index.html

+2-11
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,6 @@
1313
<!-- google ads -->
1414
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
1515

16-
<!-- baidu stats -->
17-
<script>
18-
var _hmt = _hmt || [];
19-
(function() {
20-
var hm = document.createElement("script");
21-
hm.src = "https://hm.baidu.com/hm.js?38525fdac4b5d4403900b943d4e7dd91";
22-
var s = document.getElementsByTagName("script")[0];
23-
s.parentNode.insertBefore(hm, s);
24-
})();
25-
</script>
26-
2716
<!-- google webmaster -->
2817
<meta name="google-site-verification" content="pyo9N70ZWyh8JB43bIu633mhxesJ1IcwWCZlM3jUfFo" />
2918
</head>
@@ -68,6 +57,7 @@
6857
themeColor: '#11557c',
6958
repo: 'apachecn/matplotlib-doc-zh',
7059
plugins: [window.docsPlugin],
60+
bdStatId: '38525fdac4b5d4403900b943d4e7dd91',
7161
search: {
7262
paths: 'auto',
7363
placeholder: '搜索',
@@ -86,5 +76,6 @@
8676
<script src="asset/prism-python.min.js"></script>
8777
<script src="asset/docsify-copy-code.min.js"></script>
8878
<script src="asset/docsify-baidu-push.js"></script>
79+
<script src="asset/docsify-baidu-stat.js"></script>
8980
</body>
9081
</html>

0 commit comments

Comments
 (0)