Skip to content

Commit 6151248

Browse files
committed
2020-11-23 13:16:43
1 parent 682c1a8 commit 6151248

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>
@@ -71,6 +60,7 @@
7160
alias: {
7261
'/.*/SUMMARY.md': '/SUMMARY.md',
7362
},
63+
bdStatId: '38525fdac4b5d4403900b943d4e7dd91',
7464
search: {
7565
paths: 'auto',
7666
placeholder: '搜索',
@@ -93,5 +83,6 @@
9383
<script src="asset/docsify-copy-code.min.js"></script>
9484
<script src="asset/docsify-baidu-push.js"></script>
9585
<script src="asset/docsify-baidu-push.js"></script>
86+
<script src="asset/docsify-baidu-stat.js"></script>
9687
</body>
9788
</html>

0 commit comments

Comments
 (0)