-
Notifications
You must be signed in to change notification settings - Fork 538
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. 增加基于“不蒜子”的站点总访客数、总浏览量和文章总阅读量的统计功能 2. 增加百度统计和腾讯分析的支持 3. 增加多说评论数显示功能
- Loading branch information
Showing
33 changed files
with
2,410 additions
and
2,318 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
<div class="mask" id="mask"></div> | ||
<a href="javascript:;" id="gotop" class="waves-effect waves-circle waves-light"><span class="icon icon-lg icon-chevron-up"></span></a> | ||
<script> | ||
var BLOG = { ROOT: '<%= config.root %>', SHARE: <%- theme.share %>, REWARD: <%- Boolean(page.reward) %> }</script> | ||
<% if(theme.share){ %> | ||
<%- partial('post/share', {scope: 'global'}) %> | ||
<% } %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,15 @@ | ||
<footer class="footer"> | ||
<p><a rel="license" target="_blank" href="http://creativecommons.org/licenses/by-nc-sa/4.0/"><img alt="Creative Commons License" style="border-width:0;vertical-align:middle;" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAAPCAMAAABEF7i9AAAAllBMVEUAAAD///+rsapERER3d3eIiIjMzMzu7u4iIiKUmZO6v7rKzsoODg4RERFVVVUNDQ0NDg0PEA8zMzNLTEtbXltmZmZydnF9gn2AgICPkI+ZmZmqqqq7u7vFxsXIzMgNDQwZGRkgICAhISEkJSMnKCcuMC4xMzE5Ozk7PTtBQkFCQkJDQ0Nna2eGhoaHh4ezuLLGysbd3d1wVGpAAAAA4UlEQVR42q2T1xqCMAyFk7QsBQeKA9x7j/d/OSm22CpX0nzcpA1/T05aAOuBVkMAScQFHLnEwoCo2f1TnQIGoVMewjZEjVFN4GH1Ue1Cn2jWqwfsOOj6wDwGvotsl/c8lv7KIq1eLOsT0HMFHMIE/RZyHnlphryT9zyV+8WH5e8yQw3wnQvgAFxPTKUVi555SHR/lOfLMgVTeDlSfN+TaoUsiTyeIm+bCkHvCA2FUKG48LDtYBZBknsYP/G8NTw0gaaHyuQf4H5pecrB/FYCT2sL9zAfy1Xyjou6L8X2W7YcLyBZCRtnq/zfAAAAAElFTkSuQmCC" /></a></p> | ||
<p><%=config.title %> © <%if (theme.since_year && theme.since_year < date(new Date(), 'YYYY')) {%><%= theme.since_year %> - <%}%><%= date(new Date(), 'YYYY') %></p> | ||
<p>Power by <a href="http://hexo.io/" target="_blank">Hexo</a> Theme | ||
<a href="https://github.com/yscoder/hexo-theme-indigo" target="_blank">indigo</a></p> | ||
<a href="<%=theme.rss %>" target="_blank" class="rss" title="rss"><i class="icon icon-2x icon-rss-square"></i></a> | ||
<div class="top"> | ||
<%- partial('plugins/site-visit') %> | ||
<p> | ||
<span><a href="<%-theme.rss %>" target="_blank" class="rss" title="rss"><i class="icon icon-lg icon-rss"></i></a></span> | ||
<span>博客内容遵循 <a href="http://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">知识共享 署名 - 非商业性 - 相同方式共享 4.0协议</a></span> | ||
</p> | ||
</div> | ||
<div class="bottom"> | ||
<p> | ||
<span>Power by <a href="http://hexo.io/" target="_blank">Hexo</a> Theme <a href="https://github.com/yscoder/hexo-theme-indigo" target="_blank">indigo</a></span> | ||
<span><%-config.title %> © <%if (theme.since_year && theme.since_year < date(new Date(), 'YYYY')) {%><%- theme.since_year %> - <%}%><%- date(new Date(), 'YYYY') %></span> | ||
</p> | ||
</div> | ||
</footer> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,53 @@ | ||
<head> | ||
<meta charset="utf-8"> | ||
<% if(theme.google_site_verification){ %> | ||
<meta name="google-site-verification" content="<%- theme.google_site_verification%>"> | ||
<% }%> | ||
<% if(theme.canonical){ %> | ||
<link rel="canonical" href="<%- (theme.canonical + url_for(page.path)).replace(/index\.html$/, '') %>"> | ||
<% }%> | ||
<% | ||
var title = page.title; | ||
<%- partial('plugins/google-analytics') %> | ||
<%- partial('plugins/tajs') %> | ||
<%- partial('plugins/baidu') %> | ||
<meta charset="utf-8"> | ||
<% if(theme.google_site_verification){ %> | ||
<meta name="google-site-verification" content="<%- theme.google_site_verification%>"> | ||
<% }%> | ||
<% if(theme.canonical){ %> | ||
<link rel="canonical" href="<%- (theme.canonical + url_for(page.path)).replace(/index\.html$/, '') %>"> | ||
<% }%> | ||
<% | ||
var title = page.title; | ||
if (is_archive()){ | ||
title = theme.archives_title || 'Archives'; | ||
if (is_archive()){ | ||
title = theme.archives_title || 'Archives'; | ||
if (is_month()){ | ||
title += ': ' + page.year + '/' + page.month; | ||
} else if (is_year()){ | ||
title += ': ' + page.year; | ||
} | ||
} else if (is_category()){ | ||
title = (theme.categories_title || 'Categories') + ': ' + page.category; | ||
} else if (is_tag()){ | ||
title = (theme.tags_title || 'Tags') + ': ' + page.tag; | ||
} | ||
%> | ||
<title><% if (title){ %><%= title %> | <% } %><%= config.title %> | <%= config.subtitle %></title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> | ||
<% if(theme.color){ %> | ||
<meta name="theme-color" content="<%=theme.color%>"> | ||
<% } %> | ||
<% | ||
var keyWords = config.keywords; | ||
if(page.tags){ | ||
keyWords = []; | ||
if (is_month()){ | ||
title += ': ' + page.year + '/' + page.month; | ||
} else if (is_year()){ | ||
title += ': ' + page.year; | ||
} | ||
} else if (is_category()){ | ||
title = (theme.categories_title || 'Categories') + ': ' + page.category; | ||
} else if (is_tag()){ | ||
title = (theme.tags_title || 'Tags') + ': ' + page.tag; | ||
} | ||
%> | ||
<title><% if (title){ %><%= title %> | <% } %><%= config.title %> | <%= config.subtitle %></title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> | ||
<% if(theme.color){ %> | ||
<meta name="theme-color" content="<%=theme.color%>"> | ||
<% } %> | ||
<% | ||
var keyWords = config.keywords; | ||
if(page.tags){ | ||
keyWords = []; | ||
_.isArray(page.tags) ? ( keyWords = page.tags ) | ||
: page.tags.each(function(k){ | ||
keyWords.push(k.name); | ||
}); | ||
} | ||
%> | ||
<meta name="keywords" content="<%= keyWords %>"> | ||
<%- open_graph({twitter_id: theme.twitter, google_plus: theme.google_plus, fb_admins: theme.fb_admins, fb_app_id: theme.fb_app_id}) %> | ||
<% if (theme.rss){ %> | ||
<link rel="alternative" href="<%- theme.rss %>" title="<%= config.title %>" type="application/atom+xml"> | ||
<% } %> | ||
<%- favicon_tag(theme.favicon) %> | ||
<link rel="stylesheet" href="<%= url_for('/css/style.css?v='+ theme_version()) %>"> | ||
<script>window.lazyScripts=[]</script> | ||
<%- partial('google-analytics') %> | ||
_.isArray(page.tags) ? ( keyWords = page.tags ) | ||
: page.tags.each(function(k){ | ||
keyWords.push(k.name); | ||
}); | ||
} | ||
%> | ||
<meta name="keywords" content="<%= keyWords %>"> | ||
<%- open_graph({twitter_id: theme.twitter, google_plus: theme.google_plus, fb_admins: theme.fb_admins, fb_app_id: theme.fb_app_id}) %> | ||
<% if (theme.rss){ %> | ||
<link rel="alternative" href="<%- theme.rss %>" title="<%= config.title %>" type="application/atom+xml"> | ||
<% } %> | ||
<%- favicon_tag(theme.favicon) %> | ||
<link rel="stylesheet" href="<%= url_for('/css/style.css?v='+ theme_version()) %>"> | ||
<script>window.lazyScripts=[]</script> | ||
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,8 +32,6 @@ | |
</li> | ||
<% } %> | ||
</ul> | ||
|
||
<%- partial('footer') %> | ||
</div> | ||
</div> | ||
</aside> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<% if (theme.baidu_tongji){ %> | ||
<!-- Baidu Tongji --> | ||
<script>var _hmt = _hmt || []</script> | ||
<script async src="//hm.baidu.com/hm.js?<%- theme.baidu_tongji %>"></script> | ||
<!-- End Baidu Tongji --> | ||
<% } %> | ||
|
||
<% if(theme.baidu_push){ %> | ||
<!-- Baidu Push --> | ||
<script> | ||
(function(){ | ||
var bp = document.createElement('script'); | ||
var curProtocol = window.location.protocol.split(':')[0]; | ||
if (curProtocol === 'https') { | ||
bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; | ||
} | ||
else { | ||
bp.src = 'http://push.zhanzhang.baidu.com/push.js'; | ||
} | ||
var s = document.getElementsByTagName("script")[0]; | ||
s.parentNode.insertBefore(bp, s); | ||
})(); | ||
</script> | ||
<!-- End Baidu Push --> | ||
<% } %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<% if (theme.disqus_shortname){ %> | ||
<section class="comments" id="comments"> | ||
<div id="disqus_thread"></div> | ||
<script> | ||
var disqus_shortname = '<%- theme.disqus_shortname %>'; | ||
lazyScripts.push('//' + disqus_shortname + '.disqus.com/embed.js') | ||
</script> | ||
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> | ||
</section> | ||
<% } %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<% if (theme.duoshuo && post.comments){ %> | ||
<span> | ||
<a href="<%- url_for(post.path) %>#comments" class="ds-thread-count" data-thread-key="<%- post.slug %>" data-count-type="comments"></a> | ||
</span> | ||
<% }%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<% if (theme.duoshuo){ %> | ||
var duoshuoQuery = {short_name:'<%- theme.duoshuo %>', theme: 'none'}; | ||
lazyScripts.push('<%- url_for('/js/embed' + (cache ? '.min': '') + '.js?v=' + theme_version()) %>'); | ||
<% } %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<% if (theme.duoshuo){ %> | ||
<div class="comments" id="comments"> | ||
<div class="ds-thread" data-thread-key="<%-key%>" data-title="<%=title%>" data-url="<%=url.replace(/index\.html$/, '')%>"></div> | ||
</div> | ||
<script> | ||
lazyScripts.push('//cdn.bootcss.com/marked/0.3.6/marked.min.js') | ||
</script> | ||
<% } %> |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<% if (theme.visit_counter) { %> | ||
<span id="busuanzi_container_page_pv" title="文章总阅读量" style='display:none'> | ||
<i class="icon icon-eye icon-pr"></i><span id="busuanzi_value_page_pv"></span> | ||
</span> | ||
<% } %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<% if (theme.visit_counter) { %> | ||
<p> | ||
<span id="busuanzi_container_site_uv" style='display:none'> | ||
<%- theme.visit_counter.site_uv %><span id="busuanzi_value_site_uv"></span> | ||
</span> | ||
<span id="busuanzi_container_site_pv" style='display:none'> | ||
<%- theme.visit_counter.site_pv %><span id="busuanzi_value_site_pv"></span> | ||
</span> | ||
</p> | ||
<% } %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<% if (theme.tajs){ %> | ||
<!-- Tencent Speed --> | ||
<script>var _speedMark = new Date()</script> | ||
<!-- End Tencent Speed --> | ||
<!-- Tencent Analysis --> | ||
<script async src="//tajs.qq.com/stats?sId=<%- theme.tajs %>"></script> | ||
<!-- End Tencent Analysis --> | ||
<% } %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,9 @@ | ||
<% if (theme.duoshuo && post.comments){ %> | ||
<%- partial('duoshuo', { | ||
<% if(post.comments){ %> | ||
<%- partial('../plugins/duoshuo', { | ||
key: post.slug, | ||
title: post.title, | ||
url: url | ||
}) %> | ||
<% } %> | ||
<% if (post.comments && theme.disqus_shortname){ %> | ||
<section id="comments"> | ||
<div id="disqus_thread"></div> | ||
<script> | ||
var disqus_shortname = '<%- theme.disqus_shortname %>'; | ||
lazyScripts.push('//' + disqus_shortname + '.disqus.com/embed.js') | ||
</script> | ||
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> | ||
</section> | ||
<% } %> | ||
<%- partial('../plugins/disqus') %> | ||
<%} %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
<time datetime="<%= date_xml(post.date) %>" itemprop="datePublished" class="post-time"> | ||
<%= post.date.format(date_format) %> | ||
</time> | ||
<time class="post-time" title="<%- post.date.format('YYYY-M-D H:mm') %>" datetime="<%- date_xml(post.date) %>" itemprop="datePublished"><%- post.date.format(date_format) %></time> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<% if(theme.show_last_updated){ %> | ||
<span class="post-time"> | ||
最后更新时间:<time datetime="<%- date_xml(post.updated) %>" title="<%- post.updated.formt('YYYY-M-D H:mm') %>" itemprop="dateUpdated"><%- post.updated.format('YYYY年M月D日 H:mm') %></time> | ||
</span><br> | ||
<%} %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,20 @@ | ||
<script src="//cdn.bootcss.com/node-waves/0.7.4/waves.min.js"></script> | ||
|
||
<%- partial('mathjax') %> | ||
|
||
<script> | ||
var BLOG = { ROOT: '<%= config.root %>', SHARE: <%- theme.share %>, REWARD: <%- Boolean(page.reward) %> }; | ||
<%- partial('plugins/duoshuo-js') %> | ||
<% if (theme.cnzz){ %> | ||
<script>lazyScripts.push('//s95.cnzz.com/z_stat.php?id=<%-theme.cnzz %>&web_id=<%-theme.cnzz %>')</script> | ||
lazyScripts.push('//s95.cnzz.com/z_stat.php?id=<%-theme.cnzz %>&web_id=<%-theme.cnzz %>') | ||
<% } %> | ||
</script> | ||
|
||
<script src="<%- url_for('/js/main' + (cache ? '.min': '') + '.js?v=' + theme_version()) %>"></script> | ||
|
||
<% if (theme.search){ %> | ||
<%- partial('search') %> | ||
<script src="<%- url_for('/js/search' + (cache ? '.min': '') + '.js?v=' + theme_version()) %>" async></script> | ||
<% } %> | ||
|
||
<%- partial('plugins/mathjax') %> | ||
|
||
<% if (theme.visit_counter) { %> | ||
<script async src="//dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script> | ||
<% } %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
8843437
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
现在做了一个 深色的 footer 在最下面感觉好违和。。。。
还是原来的在左下角的布局更好看
8843437
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同感+1
8843437
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
layout/_partial/post/updated.ejs 第3行
post.updated.formt
拼写错误8843437
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
习惯就好了。
后面的版本我会把 categories/index 去掉,分类加到左侧二级菜单。
@xdcxdc @yuangezhizao