Skip to content

Commit b3a050a

Browse files
committed
docs: add hm script
1 parent b36c663 commit b3a050a

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

site/index.html

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@
1818
</style>
1919
<script>
2020
var _hmt = _hmt || [];
21+
var isGithub = location.host.indexOf('github') !== -1;
22+
var src = isGithub ? 'https://hm.baidu.com/hm.js?b3ef688fa86bfb75027f1b410180a867' : 'https://hm.baidu.com/hm.js?1564b57c5b8f74933e4fedca9dc75b0d';
2123
(function() {
22-
const hm = document.createElement('script')
23-
hm.src = 'https://hm.baidu.com/hm.js?b3ef688fa86bfb75027f1b410180a867'
24-
const s = document.getElementsByTagName('script')[0]
25-
s.parentNode.insertBefore(hm, s)
24+
var hm = document.createElement('script');
25+
hm.src = src;
26+
var s = document.getElementsByTagName('script')[0];
27+
s.parentNode.insertBefore(hm, s);
2628
})()
2729
</script>
2830
</head>
@@ -50,4 +52,4 @@
5052
</script>
5153
</body>
5254

53-
</html>
55+
</html>

0 commit comments

Comments
 (0)