Skip to content

Commit

Permalink
增加百度统计和谷歌分析设置
Browse files Browse the repository at this point in the history
  • Loading branch information
monniya committed Jun 14, 2016
1 parent 4e75ac3 commit 343c60e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
3 changes: 2 additions & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ fancybox: true

duoshuo_shortname:

google_analytics:
google_analytics: UA-78918255-1
baidu_tongji: 9cdad07c755fa23f6aced510c6760e87
favicon: /images/avatar-small.png

12 changes: 12 additions & 0 deletions layout/_partial/baidu_tongji.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<% 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>
<% } %>

11 changes: 1 addition & 10 deletions layout/_partial/head.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,5 @@
<% if (theme.social["google_plus"]) { %>
<link rel="author" href="<%= theme.social['google_plus'] %>"/>
<% } %>
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "//hm.baidu.com/hm.js?9cdad07c755fa23f6aced510c6760e87";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>


</head>
1 change: 1 addition & 0 deletions layout/layout.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@


<%- partial('_partial/google_analytics') %>
<%- partial('_partial/baidu_tongji') %>
</body>
</html>

0 comments on commit 343c60e

Please sign in to comment.