Skip to content

Commit

Permalink
add: 百度统计
Browse files Browse the repository at this point in the history
  • Loading branch information
MOxFIVE committed Feb 19, 2016
1 parent 443f457 commit 74353f0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@ google_site:
# Fill in Google Analytics tracking ID, #e.g. UA-XXXXX-X
google_analytics:

# 百度统计 http://sitecenter.baidu.com/sc-web/
# 查看代码,填入 //hm.baidu.com/hm.js? 之后的内容
baidu_tongji:

# 不蒜子网站计数设置
# http://ibruce.info/2015/04/04/busuanzi/
visit_counter:
Expand Down
11 changes: 11 additions & 0 deletions layout/_partial/head.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,15 @@
open_in_new: <%=theme.open_in_new%>
}
</script>
<% if (theme.baidu_tongji){ %>
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "//hm.baidu.com/hm.js?<%=theme.baidu_tongji%>";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
<% } %>
</head>

2 comments on commit 74353f0

@Arondight
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

boom,之前一直手动加的,好像不需要了

@ljfxyj2008
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

博主你效率真高啊 赞!!!

Please sign in to comment.