👽 运行脚本优化

👽 运行脚本优化
pull/1/head
RYAN0UP_ 2018-04-23 14:23:28 +08:00
parent c234bb8163
commit f00877c8de
93 changed files with 13 additions and 4494 deletions

View File

@ -20,7 +20,7 @@ start(){
if [ $? -eq "0" ]; then
echo "${APP_NAME} 正在运行。 pid=${pid} ."
else
nohup java -Xms512m -Xmx768m -jar $APP_NAME > /dev/null 2>&1 &
nohup java -server -Xms512m -Xmx768m -jar $APP_NAME > /dev/null 2>&1 &
echo "${APP_NAME}启动成功,请查看日志确保运行正常。"
fi
}

View File

@ -1,5 +1,9 @@
server:
port: 8090
tomcat:
min-spare-threads: 20
max-threads: 100
max-connections: 5000
spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource

View File

@ -162,7 +162,7 @@
<div class="small-box bg-red">
<div class="inner"><h3 id="blogStart">1</h3><p>成立天数</p></div>
<div class="icon"><i class="ion ion-pie-graph"></i></div>
<a href="#" class="small-box-footer">${options.site_start?default('0000-00-00')} <i class="fa fa-star"></i></a>
<a href="#" class="small-box-footer">${options.blog_start?default('0000-00-00')} <i class="fa fa-star"></i></a>
</div>
</div>
</#if>

View File

@ -339,7 +339,7 @@
<label for="materialSnsShareTwitter" class="col-sm-4 control-label">分享到Twitter</label>
<div class="col-sm-8">
<label class="radio-inline">
<input type="radio" name="theme_material_sns_share_twitter" id="materialSnsShareTwitter" value="true" ${((options.theme_material_sns_share_twitter?if_exists)=='true')?string('checked','')}> 开启
<input type="radio" name="theme_material_sns_share_twitter" id="materialSnsShareTwitter" value="true" ${((options.theme_material_sns_share_twitter?default('true'))=='true')?string('checked','')}> 开启
</label>
<label class="radio-inline">
<input type="radio" name="theme_material_sns_share_twitter" id="materialSnsShareTwitter" value="false" ${((options.theme_material_sns_share_twitter?if_exists)=='false')?string('checked','')}> 关闭
@ -350,7 +350,7 @@
<label for="materialSnsShareFaceBook" class="col-sm-4 control-label">分享到Facebook</label>
<div class="col-sm-8">
<label class="radio-inline">
<input type="radio" name="theme_material_sns_share_facebook" id="materialSnsShareFaceBook" value="true" ${((options.theme_material_sns_share_facebook?if_exists)=='true')?string('checked','')}> 开启
<input type="radio" name="theme_material_sns_share_facebook" id="materialSnsShareFaceBook" value="true" ${((options.theme_material_sns_share_facebook?default('true'))=='true')?string('checked','')}> 开启
</label>
<label class="radio-inline">
<input type="radio" name="theme_material_sns_share_facebook" id="materialSnsShareFaceBook" value="false" ${((options.theme_material_sns_share_facebook?if_exists)=='false')?string('checked','')}> 关闭
@ -362,7 +362,7 @@
<label for="materialSnsShareGoogleplus" class="col-sm-4 control-label">分享到GooglePlus</label>
<div class="col-sm-8">
<label class="radio-inline">
<input type="radio" name="theme_material_sns_share_googleplus" id="materialSnsShareGoogleplus" value="true" ${((options.theme_material_sns_share_googleplus?if_exists)=='true')?string('checked','')}> 开启
<input type="radio" name="theme_material_sns_share_googleplus" id="materialSnsShareGoogleplus" value="true" ${((options.theme_material_sns_share_googleplus?default('true'))=='true')?string('checked','')}> 开启
</label>
<label class="radio-inline">
<input type="radio" name="theme_material_sns_share_googleplus" id="materialSnsShareGoogleplus" value="false" ${((options.theme_material_sns_share_googleplus?if_exists)=='false')?string('checked','')}> 关闭
@ -374,7 +374,7 @@
<label for="materialSnsShareWeibo" class="col-sm-4 control-label">分享到Weibo</label>
<div class="col-sm-8">
<label class="radio-inline">
<input type="radio" name="theme_material_sns_share_weibo" id="materialSnsShareWeibo" value="true" ${((options.theme_material_sns_share_weibo?if_exists)=='true')?string('checked','')}> 开启
<input type="radio" name="theme_material_sns_share_weibo" id="materialSnsShareWeibo" value="true" ${((options.theme_material_sns_share_weibo?default('true'))=='true')?string('checked','')}> 开启
</label>
<label class="radio-inline">
<input type="radio" name="theme_material_sns_share_weibo" id="materialSnsShareWeibo" value="false" ${((options.theme_material_sns_share_weibo?if_exists)=='false')?string('checked','')}> 关闭
@ -386,7 +386,7 @@
<label for="materialSnsShareLinkedin" class="col-sm-4 control-label">分享到Linkedin</label>
<div class="col-sm-8">
<label class="radio-inline">
<input type="radio" name="theme_material_sns_share_linkedin" id="materialSnsShareLinkedin" value="true" ${((options.theme_material_sns_share_linkedin?if_exists)=='true')?string('checked','')}> 开启
<input type="radio" name="theme_material_sns_share_linkedin" id="materialSnsShareLinkedin" value="true" ${((options.theme_material_sns_share_linkedin?default('true'))=='true')?string('checked','')}> 开启
</label>
<label class="radio-inline">
<input type="radio" name="theme_material_sns_share_linkedin" id="materialSnsShareLinkedin" value="false" ${((options.theme_material_sns_share_linkedin?if_exists)=='false')?string('checked','')}> 关闭
@ -398,7 +398,7 @@
<label for="materialSnsShareqq" class="col-sm-4 control-label">分享到QQ</label>
<div class="col-sm-8">
<label class="radio-inline">
<input type="radio" name="theme_material_sns_share_qq" id="materialSnsShareqq" value="true" ${((options.theme_material_sns_share_qq?if_exists)=='true')?string('checked','')}> 开启
<input type="radio" name="theme_material_sns_share_qq" id="materialSnsShareqq" value="true" ${((options.theme_material_sns_share_qq?default('true'))=='true')?string('checked','')}> 开启
</label>
<label class="radio-inline">
<input type="radio" name="theme_material_sns_share_qq" id="materialSnsShareqq" value="false" ${((options.theme_material_sns_share_qq?if_exists)=='false')?string('checked','')}> 关闭
@ -410,7 +410,7 @@
<label for="materialSnsShareelegram" class="col-sm-4 control-label">分享到Telegram</label>
<div class="col-sm-8">
<label class="radio-inline">
<input type="radio" name="theme_material_sns_share_telegram" id="materialSnsShareTelegram" value="true" ${((options.theme_material_sns_share_telegram?if_exists)=='true')?string('checked','')}> 开启
<input type="radio" name="theme_material_sns_share_telegram" id="materialSnsShareTelegram" value="true" ${((options.theme_material_sns_share_telegram?default('true'))=='true')?string('checked','')}> 开启
</label>
<label class="radio-inline">
<input type="radio" name="theme_material_sns_share_telegram" id="materialSnsShareTelegram" value="false" ${((options.theme_material_sns_share_telegram?if_exists)=='false')?string('checked','')}> 关闭

View File

@ -1,5 +0,0 @@
<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>
<% if(theme.share){ %>
<%- partial('post/share', {scope: 'global'}) %>
<% } %>

View File

@ -1,16 +0,0 @@
<div class="waterfall-item">
<article class="article-card archive-article">
<div class="post-meta">
<%- partial('post/date', { post: post, date_format: date_format}) %>
<%- partial('post/category', { post: post }) %>
</div>
<%- partial('post/title', {
hasLink: true
}) %>
<% if(post.tags && post.tags.length){ %>
<div class="post-footer">
<%- partial('post/tag') %>
</div>
<% } %>
</article>
</div>

View File

@ -1,21 +0,0 @@
<footer class="footer">
<div class="top">
<%- partial('plugins/site-visit') %>
<p>
<% if ((config.feed) && (config.feed.path.length)) { %>
<span><a href="<%- url_for(config.feed.path) %>" target="_blank" class="rss" title="rss"><i class="icon icon-lg icon-rss"></i></a></span>
<% } %>
<span><%- __('footer.license') %></span>
</p>
</div>
<div class="bottom">
<p><span><%-config.author %> &copy; <%if (theme.since_year && theme.since_year < date(new Date(), 'YYYY')) {%><%- theme.since_year %> - <%}%><%- date(new Date(), 'YYYY') %></span>
<span>
<% if(theme.ICP_license) {%>
<a href="http://www.miitbeian.gov.cn/" target="_blank"><%- theme.ICP_license %></a><br>
<% } %>
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>
</p>
</div>
</footer>

View File

@ -1,64 +0,0 @@
<head>
<%- 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.sogou_site_verification){ %>
<meta name="sogou_site_verification" content="<%- theme.sogou_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_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 %><% if (config.subtitle){ %> | <%= 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 ((config.feed) && (config.feed.path.length)) { %>
<link rel="alternate" type="application/atom+xml" title="<%= config.title %>" href="<%- url_for(config.feed.path) %>">
<% } %>
<%- favicon_tag(theme.favicon) %>
<link rel="stylesheet" href="<%- url_for(theme_css('/css/style', cache)) %>">
<script>window.lazyScripts=[]</script>
<!-- custom head -->
<% if (site.data.head) { %>
<% for (var i in site.data.head) { %>
<%- site.data.head[i] %>
<% } %>
<% } %>
</head>

View File

@ -1,46 +0,0 @@
<#macro header title="" hdClass="">
<header class="top-header" id="header">
<div class="flex-row">
<a href="javascript:;" class="header-icon waves-effect waves-circle waves-light on" id="menu-toggle">
<i class="icon icon-lg icon-navicon"></i>
</a>
<div class="flex-col header-title ellipsis">${title}</div>
<% if(theme.search){ %>
<div class="search-wrap" id="search-wrap">
<a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="back">
<i class="icon icon-lg icon-chevron-left"></i>
</a>
<input type="text" id="key" class="search-input" autocomplete="off" placeholder="<%= __('global.search_input_hint') %>">
<a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="search">
<i class="icon icon-lg icon-search"></i>
</a>
</div>
<% }%>
<% if(theme.share){ %>
<a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="menuShare">
<i class="icon icon-lg icon-share-alt"></i>
</a>
<% } %>
</div>
</header>
<header class="content-header ${hdClass}">
<div class="container fade-scale">
<h1 class="title">${title}</h1>
<h5 class="subtitle">
<% if(is_post()){ %>
<%- partial('post/head-meta') %>
<% } else if(is_home()){ %>
<%- config.subtitle %>
<% } else if (page.layout === 'page' && page.description) {%>
<%- page.description %>
<% } %>
</h5>
</div>
<%- partial('tags-bar', {
type: hdClass.split('-')[0]
}) %>
</header>
</#macro>

View File

@ -1,25 +0,0 @@
<#macro post post="">
<article id="${post.postUrl}"
class="article-card article-type-${post}" itemprop="blogPost">
<div class="post-meta">
<#include "post/date.ftl">
<#include "post/category.ftl">
</div>
<#include "post/title.ftl">
<@title hasLink="true"></@title>
<div class="post-content" id="post-content" itemprop="postContent">
${post.postSummary?if_exists}
<a href="${post.postUrl}" class="post-more waves-effect waves-button">
继续阅读...
</a>
</div>
<#if post.tags?size gt 0>
<div class="post-footer">
<#include "post/tag.ftl">
</div>
</#if>
</article>
</#macro>

View File

@ -1 +0,0 @@
<div id="loading" class="active"></div>

View File

@ -1,32 +0,0 @@
<aside id="menu" <% if((is_post() || page.layout === 'page') && theme.hideMenu){ %>class="hide"<% } %> >
<div class="inner flex-row-vertical">
<a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="menu-off">
<i class="icon icon-lg icon-close"></i>
</a>
<div class="brand-wrap"
style="background-image:url(${options.indigo_general_brand?default("/indigo/source/img/brand.jpg")})">
<div class="brand">
<a href="${user.userAvatar?default("/indigo/source/img/avatar.jpg")}"
class="avatar waves-effect waves-circle waves-light">
<img src="${user.userAvatar?default("/indigo/source/img/avatar.jpg")}">
</a>
<hgroup class="introduce">
<h5 class="nickname">${user.userDisplayName?default("indigo")}</h5>
<a href="mailto:i@ryanc.cc" title="${user.userEmail}" class="mail">${user.userEmail}</a>
</hgroup>
</div>
</div>
<div class="scroll-wrap flex-col">
<ul class="nav">
<#list menus as menu>
<li class="waves-block waves-effect active">
<a href="${menu.menuUrl}">
<i class="icon icon-lg ${menu.menuIcon?default("")}"></i>
${menu.menuName}
</a>
</li>
</#list>
</ul>
</div>
</div>
</aside>

View File

@ -1,10 +0,0 @@
<% if (page.total > 1){ %>
<nav id="page-nav">
<div class="inner">
<%- paginator({
prev_text: '上一页',
next_text: '下一页'
}) %>
</div>
</nav>
<% } %>

View File

@ -1,25 +0,0 @@
<% 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 -->
<% } %>

View File

@ -1,10 +0,0 @@
<% 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>
<% } %>

View File

@ -1,18 +0,0 @@
<% if (theme.title_change) { %>
<script>
(function() {
var OriginTitile = document.title, titleTime;
document.addEventListener('visibilitychange', function() {
if (document.hidden) {
document.title = '<%- theme.title_change.leave %>';
clearTimeout(titleTime);
} else {
document.title = '<%- theme.title_change.normal %>';
titleTime = setTimeout(function() {
document.title = OriginTitile;
},2000);
}
});
})();
</script>
<% } %>

View File

@ -1,18 +0,0 @@
<% if (theme.gitment){ %>
<section class="comments" id="comments">
<div id="gitment_thread"></div>
<link rel="stylesheet" href="//unpkg.com/gitment/style/default.css">
<script src="//unpkg.com/gitment/dist/gitment.browser.js"></script>
<script>
var gitment = new Gitment({
owner: '<%- theme.gitment.owner %>',
repo: '<%- theme.gitment.repo %>',
oauth: {
client_id: '<%- theme.gitment.client_id %>',
client_secret: '<%- theme.gitment.client_secret %>',
},
})
gitment.render('comments')
</script>
</section>
<% } %>

View File

@ -1,10 +0,0 @@
<% if (theme.google_analytics){ %>
<!-- Google Analytics -->
<script>
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
ga('create', '<%- theme.google_analytics %>', 'auto');
ga('send', 'pageview');
</script>
<script async src='https://www.google-analytics.com/analytics.js'></script>
<!-- End Google Analytics -->
<% } %>

View File

@ -1,28 +0,0 @@
<% if (theme.hyper_id){ %>
<section class="comments" id="comments">
<div id="hypercomments_widget"></div>
<script type="text/javascript">
var hyper_id = '<%- theme.hyper_id %>';
_hcwp = window._hcwp || [];
_hcwp.push({
widget: "Stream",
widget_id: hyper_id
});
(function () {
if ("HC_LOAD_INIT" in window) return;
HC_LOAD_INIT = true;
var lang = (navigator.language || navigator.systemLanguage || navigator.userLanguage || "en").substr(
0, 2).toLowerCase();
var hcc = document.createElement("script");
hcc.type = "text/javascript";
hcc.async = true;
hcc.src = ("https:" == document.location.protocol ? "https" : "http") +
"://w.hypercomments.com/widget/hc/" + hyper_id + "/" + lang + "/widget.js";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hcc, s.nextSibling);
})();
</script>
<a href="http://hypercomments.com" rel="nofollow" class="hc-link" title="comments widget">comments powered by HyperComments</a>
</section>
<% } %>

View File

@ -1,22 +0,0 @@
<% if (theme.mathjax){ %>
<!-- mathjax config similar to math.stackexchange -->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
processEscapes: true,
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
}
});
MathJax.Hub.Queue(function() {
var all = MathJax.Hub.getAllJax(), i;
for(i=0; i < all.length; i += 1) {
all[i].SourceElement().parentNode.className += ' has-jax';
}
});
</script>
<script async src="//cdn.bootcss.com/mathjax/2.7.0/MathJax.js?config=TeX-MML-AM_CHTML" async></script>
<% } %>

View File

@ -1,5 +0,0 @@
<% 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>
<% } %>

View File

@ -1,10 +0,0 @@
<% 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>
<% } %>

View File

@ -1,8 +0,0 @@
<% 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 -->
<% } %>

View File

@ -1,8 +0,0 @@
<% if (theme.uyan_uid){ %>
<section class="comments" id="comments">
<!-- UY BEGIN -->
<div id="uyan_frame"></div>
<script src="http://v2.uyan.cc/code/uyan.js?uid=<%- theme.uyan_uid %>"></script>
<!-- UY END -->
</section>
<% } %>

View File

@ -1,25 +0,0 @@
<% if (theme.valine.enable ){ %>
<!-- Valine Comments -->
<div class="comments vcomment" id="comments"></div>
<script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
<script src="//unpkg.com/valine@latest/dist/Valine.min.js"></script>
<!-- Valine Comments script -->
<script>
var GUEST_INFO = ['nick','mail','link'];
var guest_info = '<%= theme.valine.guest_info %>'.split(',').filter(function(item){
return GUEST_INFO.indexOf(item) > -1
});
new Valine({
el: '#comments',
notify: '<%= theme.valine.notify %>' == 'true',
verify: '<%= theme.valine.verify %>' == 'true',
appId: "<%= theme.valine.appId %>",
appKey: "<%= theme.valine.appKey %>",
avatar: "<%= theme.valine.avatar %>",
placeholder: "<%= theme.valine.placeholder %>",
guest_info: guest_info.length == 0 ? GUEST_INFO : guest_info,
pageSize: "<%= theme.valine.pageSize %>"
})
</script>
<!-- Valine Comments end -->
<% } %>

View File

@ -1,31 +0,0 @@
<%- partial('post/toc', { post: post}) %>
<article id="<%= post.layout %>-<%= post.slug %>"
class="post-article article-type-<%= post.layout %> fade" itemprop="blogPost">
<div class="post-card">
<h1 class="post-card-title"><%- post.title %></h1>
<div class="post-meta">
<%- partial('post/date', {date_format: config.date_format}) %>
<%- partial('post/category') %>
<%- partial('plugins/page-visit') %>
</div>
<div class="post-content" id="post-content" itemprop="postContent">
<%- post.content %>
</div>
<%- partial('post/copyright') %>
<%- partial('post/reward-btn') %>
<div class="post-footer">
<%- partial('post/tag') %>
<%- partial('post/share-fab') %>
</div>
</div>
<%- partial('post/nav') %>
<%- partial('post/comment') %>
</article>
<%- partial('post/reward') %>

View File

@ -1,9 +0,0 @@
<#if post.categories?size gt 0>
<ul class="article-category-list">
<#list post.categories as cate>
<li class="article-category-list-item">
<a class="article-category-list-link" href="/categories/${cate.cateUrl}/">${cate.cateName}</a>
</li>
</#list>
</ul>
</#if>

View File

@ -1,12 +0,0 @@
<% if(post.comments){ %>
<%- partial('../plugins/disqus') %>
<%- partial('../plugins/uyan') %>
<%- partial('../plugins/gitment') %>
<%- partial('../plugins/valine') %>
<%- partial('../plugins/hyper-comments') %>
<%} %>

View File

@ -1,16 +0,0 @@
<blockquote class="post-copyright">
<% if(theme.postMessage || theme.show_last_updated) { %>
<div class="content">
<%- partial('updated') %>
<% if(theme.postMessage) {%>
<%- _.template(theme.postMessage)(locals) %>
<% } %>
</div>
<% } %>
<footer>
<a href="<%- config.url %>">
<img src="<%- url_for(theme.avatar) %>" alt="<%- config.author %>">
<%- config.author %>
</a>
</footer>
</blockquote>

View File

@ -1 +0,0 @@
<time class="post-time" title="${post.postDate?string("yyyy-MM-dd")}" datetime="${post.postDate}" itemprop="datePublished">${post.postDate?string("yyyy-MM-dd")}</time>

View File

@ -1,11 +0,0 @@
<time datetime="<%= date_xml(page.date) %>" itemprop="datePublished" class="page-time">
<%= page.date.format(config.date_format) %>
</time>
<% if (page.categories && page.categories.length){ %>
<%- list_categories(page.categories, {
show_count: false,
class: 'article-category',
style: 'list'
}) %>
<% } %>

View File

@ -1,25 +0,0 @@
<% if (post.prev || post.next){ %>
<nav class="post-nav flex-row flex-justify-between<% if(!post.prev){ %> flex-row-reverse<% } %>">
<% if (post.prev){
var prevTitle = post.prev.title || '[no title]';
%>
<div class="waves-block waves-effect prev">
<a href="<%- url_for(post.prev.path) %>" id="post-prev" class="post-nav-link">
<div class="tips"><i class="icon icon-angle-left icon-lg icon-pr"></i> Prev</div>
<h4 class="title"><%=prevTitle %></h4>
</a>
</div>
<% } %>
<% if (post.next){
var nextTitle = post.next.title || '[no title]';
%>
<div class="waves-block waves-effect next">
<a href="<%- url_for(post.next.path) %>" id="post-next" class="post-nav-link">
<div class="tips">Next <i class="icon icon-angle-right icon-lg icon-pl"></i></div>
<h4 class="title"><%=nextTitle %></h4>
</a>
</div>
<% } %>
</nav>
<% } %>

View File

@ -1,5 +0,0 @@
<% if(page.reward){ %>
<div class="page-reward">
<a id="rewardBtn" href="javascript:;" class="page-reward-btn waves-effect waves-circle waves-light">赏</a>
</div>
<% } %>

View File

@ -1,30 +0,0 @@
<% if(page.reward){ %>
<div id="reward" class="page-modal reward-lay">
<a class="close" href="javascript:;"><i class="icon icon-close"></i></a>
<h3 class="reward-title">
<i class="icon icon-quote-left"></i>
<%=theme.reward.title %>
<i class="icon icon-quote-right"></i>
</h3>
<div class="reward-content">
<%
var wechat = theme.reward.wechat;
var alipay = theme.reward.alipay;
%>
<div class="reward-code">
<img id="rewardCode" src="<%- url_for(wechat || alipay) %>" alt="打赏二维码">
</div>
<% if(!!wechat && !!alipay) { %>
<label class="reward-toggle">
<input id="rewardToggle" type="checkbox" class="reward-toggle-check"
data-wechat="<%- url_for(wechat) %>" data-alipay="<%- url_for(alipay) %>">
<div class="reward-toggle-ctrol">
<span class="reward-toggle-item wechat">微信</span>
<span class="reward-toggle-label"></span>
<span class="reward-toggle-item alipay">支付宝</span>
</div>
</label>
<% } %>
</div>
</div>
<% } %>

View File

@ -1,8 +0,0 @@
<% if(theme.share){ %>
<div class="page-share-wrap">
<%- partial('share', { scope: 'page' }) %>
<a href="javascript:;" id="shareFab" class="page-share-fab waves-effect waves-circle">
<i class="icon icon-share-alt icon-lg"></i>
</a>
</div>
<% } %>

View File

@ -1,53 +0,0 @@
<%
// 使用 sns 直接分享接口
// 微信使用 qrcode helper 或 http://goqr.me/api/ 生成二维码
var sUrl = url.replace(/index\.html$/, '')
var sTitle = page.title ? '《'+ page.title +'》 — ' + config.title : config.title
var sDesc = truncate(strip_html(page.excerpt || config.description), { length: 80})
var sPic = page.photos && page.photos.length ? page.photos[0]
: (/^(http:|https:)?\/\//.test(theme.avatar) ? theme.avatar
: config.url.replace(/\/$/, '') + theme.avatar)
%>
<div class="<%- scope %>-share" id="<%- scope %>Share">
<ul class="reset share-icons">
<li>
<a class="weibo share-sns" target="_blank" href="http://service.weibo.com/share/share.php?url=<%-sUrl%>&title=<%-sTitle%>&pic=<%-sPic%>" data-title="微博">
<i class="icon icon-weibo"></i>
</a>
</li>
<li>
<a class="weixin share-sns wxFab" href="javascript:;" data-title="微信">
<i class="icon icon-weixin"></i>
</a>
</li>
<li>
<a class="qq share-sns" target="_blank" href="http://connect.qq.com/widget/shareqq/index.html?url=<%-sUrl%>&title=<%-sTitle%>&source=<%-sDesc%>" data-title=" QQ">
<i class="icon icon-qq"></i>
</a>
</li>
<li>
<a class="facebook share-sns" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=<%-sUrl%>" data-title=" Facebook">
<i class="icon icon-facebook"></i>
</a>
</li>
<li>
<a class="twitter share-sns" target="_blank" href="https://twitter.com/intent/tweet?text=<%-sTitle%>&url=<%-sUrl%>&via=<%-config.url%>" data-title=" Twitter">
<i class="icon icon-twitter"></i>
</a>
</li>
<li>
<a class="google share-sns" target="_blank" href="https://plus.google.com/share?url=<%-sUrl%>" data-title=" Google+">
<i class="icon icon-google-plus"></i>
</a>
</li>
</ul>
</div>
<% if(scope === 'global') { %>
<div class="page-modal wx-share" id="wxShare">
<a class="close" href="javascript:;"><i class="icon icon-close"></i></a>
<p>扫一扫,分享到微信</p>
<img src="<%- 'qrcode' in locals ? qrcode(sUrl) : '//api.qrserver.com/v1/create-qr-code/?data=' + sUrl %>" alt="微信分享二维码">
</div>
<% } %>

View File

@ -1,7 +0,0 @@
<ul class="article-tag-list">
<#list post.tags as tag>
<li class="article-tag-list-item">
<a class="article-tag-list-link" href="tags/${tag.tagUrl}/">${tag.tagName}</a>
</li>
</#list>
</ul>

View File

@ -1,12 +0,0 @@
<#macro title hasLink=="">
<#if hasLink == "true">
<h3 class="post-title" itemprop="name">
<a class="post-title-link" href="${post.postUrl}">${post.postTitle}</a>
</h3>
<#else >
<h3 class="post-title" itemprop="name">
${post.postTitle}
</h3>
</#if>
</#macro>

View File

@ -1,15 +0,0 @@
<% if(theme.toc){
var topic = toc(post.content, {
class: 'post-toc',
list_number: theme.toc.list_number
})
if(topic) {
%>
<aside class="post-widget">
<nav class="post-toc-wrap post-toc-shrink" id="post-toc">
<h4>TOC</h4>
<%- topic %>
</nav>
</aside>
<% }
} %>

View File

@ -1,5 +0,0 @@
<% if(theme.show_last_updated){ %>
<span class="post-time">
<%= __('post.last_updated') %><time datetime="<%- date_xml(post.updated) %>" itemprop="dateUpdated"><%- full_date(post.updated) %></time>
</span><br>
<%} %>

View File

@ -1,22 +0,0 @@
<script src="//cdn.bootcss.com/node-waves/0.7.4/waves.min.js"></script>
<script>
var BLOG = { ROOT: '<%= config.root %>', SHARE: <%- theme.share %>, REWARD: <%- Boolean(page.reward) %> };
<% if (theme.cnzz){ %>
lazyScripts.push('//s95.cnzz.com/z_stat.php?id=<%-theme.cnzz %>&web_id=<%-theme.cnzz %>')
<% } %>
</script>
<script src="<%- url_for(theme_js('/js/main', cache)) %>"></script>
<% if (theme.search){ %>
<%- partial('search') %>
<script src="<%- url_for(theme_js('/js/search', cache)) %>" async></script>
<% } %>
<%- partial('plugins/mathjax') %>
<% if (theme.visit_counter) { %>
<script async src="//dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<% } %>
<%- partial('plugins/dynamic-title') %>

View File

@ -1,17 +0,0 @@
<div class="search-panel" id="search-panel">
<ul class="search-result" id="search-result"></ul>
</div>
<template id="search-tpl">
<li class="item">
<a href="{path}" class="waves-block waves-effect">
<div class="title ellipsis" title="{title}">{title}</div>
<div class="flex-row flex-middle">
<div class="tags ellipsis">
{tags}
</div>
<time class="flex-col time">{date}</time>
</div>
</a>
</li>
</template>

View File

@ -1,45 +0,0 @@
<%
if(type === 'categories' || type === 'tags'){ %>
<div class="tabs-bar container">
<nav class="tags-list">
<a href="<%= url_for('/' + type) %>" style="-webkit-order:-1;order:-1" class="tags-list-item waves-effect waves-button waves-light
<% if(path === type + '/index.html'){%> active<%}%>"><%= __('tag.all') %></a>
<%
var options = [];
(type === 'tags' ? site.tags : site.categories).each(function(o) {
if(o.posts.length) {
options.push(o)
}
})
var index = _.findIndex(options, function(o) {
return is_current(o.path)
})
var len = options.length
var order = 0
options.forEach(function(tag, i){
if(index <= 1) {
order = i
} else {
if( i < index - 1) {
order = len - (index - 1) + i
} else {
order = i - (index - 1)
}
}
%>
<a href="<%- url_for(tag.path) %>" style="-webkit-order:<%= order%>;order:<%= order%>" class="tags-list-item waves-effect waves-button waves-light<% if(is_current(tag.path)){%> active<%}%>"><%-tag.name%></a>
<% }) %>
</nav>
<!-- PC show more-->
<div class="tags-list-more">
<a href="javascript:;" onclick="BLOG.tabBar(this)" class="action tags-list-item waves-effect waves-circle waves-light"><i class="icon icon-ellipsis-h"></i></a>
</div>
</div>
<% } %>

View File

@ -1,39 +0,0 @@
<%- partial('_partial/header', {
title: theme.archives_title,
hdClass: 'archives-header'
}) %>
<div class="container body-wrap fade">
<%
var posts = [];
page.posts.each(function(post){
posts.push(post);
});
var sortPosts = _[_.orderBy ? 'orderBy' : 'sortByOrder'](posts, ['date'], ['desc']);
%>
<%
var y = 0, m = 0;
sortPosts.forEach(function(post, i){
var dt = post.date;
var ny = post.date.year();
var nm = post.date.month();
if(ny !== y || nm !== m) {
y = ny;
m = nm;
%>
<% if(i > 0){%></div> <% } %>
<h3 class="archive-separator"><%=dt.format('MMMM, YYYY')%></h3>
<div class="waterfall">
<% } %>
<%- partial('_partial/archive', {post: post, date_format: 'MMM D'}) %>
<%})%>
</div>
<%- partial('_partial/paginator') %>
</div>

View File

@ -1,34 +0,0 @@
<%- partial('_partial/header', {
title: locals.title || theme.categories_title,
hdClass: 'categories-header'
}) %>
<div class="container body-wrap fade">
<%
if(is_category()) { %>
<div class="waterfall">
<% page.posts.each(function(post){ %>
<%- partial('_partial/archive', {post: post, date_format: config.date_format}) %>
<% }) %>
</div>
<% } else {
site.categories.each(function(cate){
if(cate.length) {
%>
<h3 class="archive-separator" id="tag-<%=cate.name %>"><%=cate.name %></h3>
<div class="waterfall">
<% cate.posts.each(function(post){ %>
<%- partial('_partial/archive', {post: post, date_format: config.date_format}) %>
<% }) %>
</div>
<% }
})
}
%>
<%- partial('_partial/paginator') %>
</div>

View File

@ -1,3 +0,0 @@
<%- partial('categories', {
title: theme.categories_title + ': ' + page.category
}) %>

View File

@ -1,20 +0,0 @@
<%- partial('_partial/header', {
title: config.title,
hdClass: 'index-header'
}) %>
<div class="container body-wrap">
<ul class="post-list">
<% page.posts.each(function(post){ %>
<li class="post-list-item fade">
<%- partial('_partial/index-item', {
post: post,
index: true
}) %>
</li>
<% }) %>
</ul>
<%- partial('_partial/paginator') %>
</div>

View File

@ -1,18 +0,0 @@
<#include "_partial/header.ftl">
<@header title="${options.blog_title}" hdClass="index-header"></@header>
<div class="container body-wrap">
<ul class="post-list">
<% page.posts.each(function(post){ %>
<li class="post-list-item fade">
<%- partial('_partial/index-item', {
post: post,
index: true
}) %>
</li>
<% }) %>
</ul>
<%- partial('_partial/paginator') %>
</div>

View File

@ -1,14 +0,0 @@
<!DOCTYPE html>
<html>
<%- partial('_partial/head') %>
<body>
<%- partial('_partial/loading') %>
<%- partial('_partial/menu') %>
<main id="main">
<%- body %>
<%- partial('_partial/footer') %>
</main>
<%- partial('_partial/after-footer') %>
<%- partial('_partial/script') %>
</body>
</html>

View File

@ -1,174 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<link rel="stylesheet" href="/static/plugins/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="/static/plugins/toast/css/jquery.toast.min.css">
<link rel="stylesheet" href="/static/css/AdminLTE.min.css">
<style>
.themeSetting,.themeImg{
padding-top: 15px;
padding-bottom: 15px;
}
.form-horizontal .control-label{
text-align: left;
}
</style>
</head>
<body>
<div class="container-fluid">
<div class="row">
<div class="col-lg-6 themeImg">
<img src="/${themeDir}/screenshot.png" style="width: 100%;">
</div>
<div class="col-md-6 themeSetting">
<div class="nav-tabs-custom">
<ul class="nav nav-tabs">
<li class="active">
<a href="#general" data-toggle="tab">基本设置</a>
</li>
<li>
<a href="#style" data-toggle="tab">样式设置</a>
</li>
<li>
<a href="#about" data-toggle="tab">关于</a>
</li>
</ul>
<div class="tab-content">
<!-- 社交资料 -->
<div class="tab-pane active" id="general">
<form method="post" class="form-horizontal" id="indigoGeneralOptions">
<div class="box-body">
<div class="form-group">
<label for="indigoGeneralBrand" class="col-sm-4 control-label">头像背景图:</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="indigoGeneralBrand" name="indigo_general_brand" value="${options.indigo_general_brand?default("indigo/source/img/brand.jpg")}" >
</div>
</div>
<div class="form-group">
<label for="indigoGeneralFavicon" class="col-sm-4 control-label">Favicon</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="indigoGeneralFavicon" name="indigo_general_favicon" value="${options.indigo_general_favicon?if_exists}" >
</div>
</div>
<div class="form-group">
<label for="anatoleSnsInstagram" class="col-sm-4 control-label">Instagram</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="anatoleSnsInstagram" name="theme_anatole_sns_instagram" value="${options.theme_anatole_sns_instagram?if_exists}" >
</div>
</div>
<div class="form-group">
<label for="anatoleSnsDribbble" class="col-sm-4 control-label">Dribbble</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="anatoleSnsDribbble" name="theme_anatole_sns_dribbble" value="${options.theme_anatole_sns_dribbble?if_exists}" >
</div>
</div>
<div class="form-group">
<label for="anatoleSnsWeibo" class="col-sm-4 control-label">Weibo</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="anatoleSnsWeibo" name="theme_anatole_sns_weibo" value="${options.theme_anatole_sns_weibo?if_exists}" >
</div>
</div>
<div class="form-group">
<label for="anatoleSnsEmail" class="col-sm-4 control-label">Email</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="anatoleSnsEmail" name="theme_anatole_sns_email" value="${options.theme_anatole_sns_email?if_exists}" >
</div>
</div>
<div class="form-group">
<label for="anatoleSnsGithub" class="col-sm-4 control-label">Github</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="anatoleSnsGithub" name="theme_anatole_sns_github" value="${options.theme_anatole_sns_github?if_exists}" >
</div>
</div>
</div>
<div class="box-footer">
<button type="button" class="btn btn-primary btn-sm pull-right" onclick="saveThemeOptions('indigoGeneralOptions')">保存设置</button>
</div>
</form>
</div>
<div class="tab-pane" id="style">
<form method="post" class="form-horizontal" id="indigoStyleOptions">
<div class="box-body">
<div class="form-group">
<label for="indigoStyleBarColor" class="col-sm-4 control-label">浏览器状态栏颜色:</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="indigoStyleBarColor" name="indigo_style_barColor" value="${options.indigo_style_barColor?default("#3F51B5")}" >
</div>
</div>
<div class="form-group">
<label for="indigoStyleTagsTitle" class="col-sm-4 control-label">标签页面标题:</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="indigoStyleTagsTitle" name="indigo_style_tagsTitle" value="${options.indigo_style_tagsTitle?default("Tags")}" >
</div>
</div>
<div class="form-group">
<label for="indigoStyleArchivesTitle" class="col-sm-4 control-label">归档页面标题:</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="indigoStyleArchivesTitle" name="indigoStyle_archivesTitle" value="${options.indigoStyle_archivesTitle?default("Archives")}" >
</div>
</div>
<div class="form-group">
<label for="indigoStyleCategoriesTitle" class="col-sm-4 control-label">归档页面标题:</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="indigoStyleCategoriesTitle" name="indigoStyle_categoriesTitle" value="${options.indigoStyle_categoriesTitle?default("Categories")}" >
</div>
</div>
<div class="form-group">
<label for="indigoStyleShowLastUpdated" class="col-sm-4 control-label">显示文章最后更新时间:</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="indigoStyleShowLastUpdated" name="indigoStyle_showLastUpdated" value="${options.indigoStyle_showLastUpdated?default("Categories")}" >
</div>
</div>
</div>
<div class="box-footer">
<button type="button" class="btn btn-primary btn-sm pull-right" onclick="saveThemeOptions('indigoStyleOptions')">保存设置</button>
</div>
</form>
</div>
<!-- 关于该主题 -->
<div class="tab-pane" id="about">
<div class="box box-widget widget-user-2">
<div class="widget-user-header bg-blue">
<div class="widget-user-image">
<img class="img-circle" src="/anatole/source/images/logo@2x.png" alt="User Avatar">
</div>
<h3 class="widget-user-username">CAICAI</h3>
<h5 class="widget-user-desc">A other farbox theme</h5>
</div>
<div class="box-footer no-padding">
<ul class="nav nav-stacked">
<li><a target="_blank" href="https://www.caicai.me/">作者主页</a></li>
<li><a target="_blank" href="https://github.com/hi-caicai/farbox-theme-Anatole">原主题地址</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
<script src="/static/plugins/jquery/jquery.min.js"></script>
<script src="/static/plugins/bootstrap/js/bootstrap.min.js"></script>
<script src="/static/plugins/toast/js/jquery.toast.min.js"></script>
<script src="/static/plugins/layer/layer.js"></script>
<script src="/static/js/app.js"></script>
<script>
function saveThemeOptions(option) {
var param = $('#'+option).serialize();
$.ajax({
type: 'post',
url: '/admin/option/save',
data: param,
success: function (data) {
showMsg("保存成功!","success",1000);
}
});
}
</script>
</html>

View File

@ -1,37 +0,0 @@
<%- partial('_partial/header', {
title: page.title,
hdClass: 'page-header'
}) %>
<%
page.reward = 'reward' in page ? (theme.reward && page.reward) : theme.reward;
page.slug = 'hexo-page-' + page.path.replace(/\/index\.html$/,'').split('/').join('-');
%>
<div class="container body-wrap">
<article class="page-article fade" itemprop="blogPage">
<div class="post-content page-content" id="page-content" itemprop="pageContent">
<%- page.content.replace(/<p>}<\/p>/g, '</div>')
.replace(/<p>@([\w-]+){<\/p>/g, function(match, $1){
return '<div class="'+ $1 +'">'
}) %>
</div>
<% if(theme.about){ %>
<div class="card page-about-me flex-row">
<a href="/" class="avatar waves-effect waves-circle waves-light"><%- image_tag(theme.avatar) %></a>
<div class="content flex-col">
<p><strong><%- config.author %></strong></p>
<p><em><%- config.subtitle %></em></p>
<p><%- theme.about %></p>
</div>
<%- partial('_partial/post/share-fab') %>
</div>
<% } %>
<%- partial('_partial/post/reward-btn') %>
<%- partial('_partial/post/comment', { post: page }) %>
</article>
<%- partial('_partial/post/reward') %>
</div>

View File

@ -1,10 +0,0 @@
<%- partial('_partial/header', {
title: page.title,
hdClass: 'post-header'
}) %>
<%
page.reward = 'reward' in page ? (theme.reward && page.reward) : theme.reward
%>
<div class="container body-wrap">
<%- partial('_partial/post', {post: page }) %>
</div>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 278 KiB

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 434 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 444 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

View File

@ -1,543 +0,0 @@
(function (w, d) {
var body = d.body,
$ = d.querySelector.bind(d),
$$ = d.querySelectorAll.bind(d),
root = $('html'),
gotop = $('#gotop'),
menu = $('#menu'),
header = $('#header'),
mask = $('#mask'),
menuToggle = $('#menu-toggle'),
menuOff = $('#menu-off'),
loading = $('#loading'),
animate = w.requestAnimationFrame,
scrollSpeed = 200 / (1000 / 60),
forEach = Array.prototype.forEach,
even = ('ontouchstart' in w && /Mobile|Android|iOS|iPhone|iPad|iPod|Windows Phone|KFAPWI/i.test(navigator.userAgent)) ? 'touchstart' : 'click',
isWX = /micromessenger/i.test(navigator.userAgent),
noop = function () { },
offset = function (el) {
var x = el.offsetLeft,
y = el.offsetTop;
if (el.offsetParent) {
var pOfs = arguments.callee(el.offsetParent);
x += pOfs.x;
y += pOfs.y;
}
return {
x: x,
y: y
};
},
rootScollTop = function() {
return d.documentElement.scrollTop || d.body.scrollTop;
};
var Blog = {
goTop: function (end) {
var top = rootScollTop();
var interval = arguments.length > 2 ? arguments[1] : Math.abs(top - end) / scrollSpeed;
if (top && top > end) {
w.scrollTo(0, Math.max(top - interval, 0));
animate(arguments.callee.bind(this, end, interval));
} else if (end && top < end) {
w.scrollTo(0, Math.min(top + interval, end));
animate(arguments.callee.bind(this, end, interval));
} else {
this.toc.actived(end);
}
},
toggleGotop: function (top) {
if (top > w.innerHeight / 2) {
gotop.classList.add('in');
} else {
gotop.classList.remove('in');
}
},
toggleMenu: function (flag) {
var main = $('#main');
if (flag) {
menu.classList.remove('hide');
if (w.innerWidth < 1241) {
mask.classList.add('in');
menu.classList.add('show');
if (isWX) {
var top = rootScollTop();
main.classList.add('lock');
main.scrollTop = top;
} else {
root.classList.add('lock');
}
}
} else {
menu.classList.remove('show');
mask.classList.remove('in');
if (isWX) {
var top = main.scrollTop;
main.classList.remove('lock');
w.scrollTo(0, top);
} else {
root.classList.remove('lock');
}
}
},
fixedHeader: function (top) {
if (top > header.clientHeight) {
header.classList.add('fixed');
} else {
header.classList.remove('fixed');
}
},
toc: (function () {
var toc = $('#post-toc');
if (!toc || !toc.children.length) {
return {
fixed: noop,
actived: noop
}
}
var bannerH = $('.post-header').clientHeight,
headerH = header.clientHeight,
titles = $('#post-content').querySelectorAll('h1, h2, h3, h4, h5, h6');
toc.querySelector('a[href="#' + titles[0].id + '"]').parentNode.classList.add('active');
// Make every child shrink initially
var tocChilds = toc.querySelectorAll('.post-toc-child');
for (i = 0, len = tocChilds.length; i < len; i++) {
tocChilds[i].classList.add('post-toc-shrink');
}
var firstChild =
toc.querySelector('a[href="#' + titles[0].id + '"]')
.nextElementSibling;
if (firstChild) {
firstChild.classList.add('post-toc-expand');
firstChild.classList.remove('post-toc-shrink');
}
toc.classList.remove('post-toc-shrink');
/**
* Handle toc active and expansion
* @param prevEle previous active li element
* @param currEle current active li element
*/
var handleTocActive = function (prevEle, currEle) {
prevEle.classList.remove('active');
currEle.classList.add('active');
var siblingChilds = currEle.parentElement.querySelectorAll('.post-toc-child');
for (j = 0, len1 = siblingChilds.length; j < len1; j++) {
siblingChilds[j].classList.remove('post-toc-expand');
siblingChilds[j].classList.add('post-toc-shrink');
}
var myChild = currEle.querySelector('.post-toc-child');
if (myChild) {
myChild.classList.remove('post-toc-shrink');
myChild.classList.add('post-toc-expand');
}
};
return {
fixed: function (top) {
top >= bannerH - headerH ? toc.classList.add('fixed') : toc.classList.remove('fixed');
},
actived: function (top) {
for (i = 0, len = titles.length; i < len; i++) {
if (top > offset(titles[i]).y - headerH - 5) {
var prevListEle = toc.querySelector('li.active');
var currListEle = toc.querySelector('a[href="#' + titles[i].id + '"]').parentNode;
handleTocActive(prevListEle, currListEle);
}
}
if (top < offset(titles[0]).y) {
handleTocActive(
toc.querySelector('li.active'),
toc.querySelector('a[href="#' + titles[0].id + '"]').parentNode
);
}
}
}
})(),
hideOnMask: [],
modal: function (target) {
this.$modal = $(target);
this.$off = this.$modal.querySelector('.close');
var _this = this;
this.show = function () {
mask.classList.add('in');
_this.$modal.classList.add('ready');
setTimeout(function () {
_this.$modal.classList.add('in');
}, 0)
}
this.onHide = noop;
this.hide = function () {
_this.onHide();
mask.classList.remove('in');
_this.$modal.classList.remove('in');
setTimeout(function () {
_this.$modal.classList.remove('ready');
}, 300)
}
this.toggle = function () {
return _this.$modal.classList.contains('in') ? _this.hide() : _this.show();
}
Blog.hideOnMask.push(this.hide);
this.$off && this.$off.addEventListener(even, this.hide);
},
share: function () {
var pageShare = $('#pageShare'),
fab = $('#shareFab');
var shareModal = new this.modal('#globalShare');
$('#menuShare').addEventListener(even, shareModal.toggle);
if (fab) {
fab.addEventListener(even, function () {
pageShare.classList.toggle('in')
}, false)
d.addEventListener(even, function (e) {
!fab.contains(e.target) && pageShare.classList.remove('in')
}, false)
}
var wxModal = new this.modal('#wxShare');
wxModal.onHide = shareModal.hide;
forEach.call($$('.wxFab'), function (el) {
el.addEventListener(even, wxModal.toggle)
})
},
search: function () {
var searchWrap = $('#search-wrap');
function toggleSearch() {
searchWrap.classList.toggle('in');
}
$('#search').addEventListener(even, toggleSearch);
},
reward: function () {
var modal = new this.modal('#reward');
$('#rewardBtn').addEventListener(even, modal.toggle);
var $rewardToggle = $('#rewardToggle');
var $rewardCode = $('#rewardCode');
if ($rewardToggle) {
$rewardToggle.addEventListener('change', function () {
$rewardCode.src = this.checked ? this.dataset.alipay : this.dataset.wechat
})
}
},
waterfall: function () {
if (w.innerWidth < 760) return;
forEach.call($$('.waterfall'), function (el) {
var childs = el.querySelectorAll('.waterfall-item');
var columns = [0, 0];
forEach.call(childs, function (item) {
var i = columns[0] <= columns[1] ? 0 : 1;
item.style.cssText = 'top:' + columns[i] + 'px;left:' + (i > 0 ? '50%' : 0);
columns[i] += item.offsetHeight;
})
el.style.height = Math.max(columns[0], columns[1]) + 'px';
el.classList.add('in')
})
},
tabBar: function (el) {
el.parentNode.parentNode.classList.toggle('expand')
},
page: (function () {
var $elements = $$('.fade, .fade-scale');
var visible = false;
return {
loaded: function () {
forEach.call($elements, function (el) {
el.classList.add('in')
});
visible = true;
},
unload: function () {
forEach.call($elements, function (el) {
el.classList.remove('in')
});
visible = false;
},
visible: visible
}
})(),
lightbox: (function () {
function LightBox(element) {
this.$img = element.querySelector('img');
this.$overlay = element.querySelector('overlay');
this.margin = 40;
this.title = this.$img.title || this.$img.alt || '';
this.isZoom = false;
var naturalW, naturalH, imgRect, docW, docH;
this.calcRect = function () {
docW = body.clientWidth;
docH = body.clientHeight;
var inH = docH - this.margin * 2;
var w = naturalW;
var h = naturalH;
var t = this.margin;
var l = 0;
var sw = w > docW ? docW / w : 1;
var sh = h > inH ? inH / h : 1;
var s = Math.min(sw, sh);
w = w * s;
h = h * s;
return {
w: w,
h: h,
t: (docH - h) / 2 - imgRect.top,
l: (docW - w) / 2 - imgRect.left + this.$img.offsetLeft
}
}
this.setImgRect = function (rect) {
this.$img.style.cssText = 'width: ' + rect.w + 'px; max-width: ' + rect.w + 'px; height:' + rect.h + 'px; top: ' + rect.t + 'px; left: ' + rect.l + 'px';
}
this.setFrom = function () {
this.setImgRect({
w: imgRect.width,
h: imgRect.height,
t: 0,
l: (element.offsetWidth - imgRect.width) / 2
})
}
this.setTo = function () {
this.setImgRect(this.calcRect());
}
// this.updateSize = function () {
// var sw = sh = 1;
// if (docW !== body.clientWidth) {
// sw = body.clientWidth / docW;
// }
// if (docH !== body.clientHeight) {
// sh = body.clientHeight / docH;
// }
// docW = body.clientWidth;
// docH = body.clientHeight;
// var rect = this.$img.getBoundingClientRect();
// var w = rect.width * sw;
// var h = rect.height * sh;
// this.$img.classList.remove('zoom-in');
// this.setImgRect({
// w: w,
// h: h,
// t: this.$img.offsetTop - (h - rect.height) / 2,
// l: this.$img.offsetLeft - (w - rect.width) / 2
// })
// }
this.addTitle = function () {
if (!this.title) {
return;
}
this.$caption = d.createElement('div');
this.$caption.innerHTML = this.title;
this.$caption.className = 'overlay-title';
element.appendChild(this.$caption);
}
this.removeTitle = function () {
this.$caption && element.removeChild(this.$caption)
}
var _this = this;
this.zoomIn = function () {
naturalW = this.$img.naturalWidth || this.$img.width;
naturalH = this.$img.naturalHeight || this.$img.height;
imgRect = this.$img.getBoundingClientRect();
element.style.height = imgRect.height + 'px';
element.classList.add('ready');
this.setFrom();
this.addTitle();
this.$img.classList.add('zoom-in');
setTimeout(function () {
element.classList.add('active');
_this.setTo();
_this.isZoom = true;
}, 0);
}
this.zoomOut = function () {
this.isZoom = false;
element.classList.remove('active');
this.$img.classList.add('zoom-in');
this.setFrom();
setTimeout(function () {
_this.$img.classList.remove('zoom-in');
_this.$img.style.cssText = '';
_this.removeTitle();
element.classList.remove('ready');
element.removeAttribute('style');
}, 300);
}
element.addEventListener('click', function (e) {
_this.isZoom ? _this.zoomOut() : e.target.tagName === 'IMG' && _this.zoomIn()
})
d.addEventListener('scroll', function () {
_this.isZoom && _this.zoomOut()
})
w.addEventListener('resize', function () {
// _this.isZoom && _this.updateSize()
_this.isZoom && _this.zoomOut()
})
}
forEach.call($$('.img-lightbox'), function (el) {
new LightBox(el)
})
})(),
loadScript: function (scripts) {
scripts.forEach(function (src) {
var s = d.createElement('script');
s.src = src;
s.async = true;
body.appendChild(s);
})
}
};
w.addEventListener('load', function () {
loading.classList.remove('active');
Blog.page.loaded();
w.lazyScripts && w.lazyScripts.length && Blog.loadScript(w.lazyScripts)
});
w.addEventListener('DOMContentLoaded', function () {
Blog.waterfall();
var top = rootScollTop();
Blog.toc.fixed(top);
Blog.toc.actived(top);
Blog.page.loaded();
});
var ignoreUnload = false;
var $mailTarget = $('a[href^="mailto"]');
if($mailTarget) {
$mailTarget.addEventListener(even, function () {
ignoreUnload = true;
});
}
w.addEventListener('beforeunload', function (e) {
if (!ignoreUnload) {
Blog.page.unload();
} else {
ignoreUnload = false;
}
});
w.addEventListener('pageshow', function () {
// fix OSX safari #162
!Blog.page.visible && Blog.page.loaded();
});
w.addEventListener('resize', function () {
w.BLOG.even = even = 'ontouchstart' in w ? 'touchstart' : 'click';
Blog.toggleMenu();
Blog.waterfall();
});
gotop.addEventListener(even, function () {
animate(Blog.goTop.bind(Blog, 0));
}, false);
menuToggle.addEventListener(even, function (e) {
Blog.toggleMenu(true);
e.preventDefault();
}, false);
menuOff.addEventListener(even, function () {
menu.classList.add('hide');
}, false);
mask.addEventListener(even, function (e) {
Blog.toggleMenu();
Blog.hideOnMask.forEach(function (hide) {
hide()
});
e.preventDefault();
}, false);
d.addEventListener('scroll', function () {
var top = rootScollTop();
Blog.toggleGotop(top);
Blog.fixedHeader(top);
Blog.toc.fixed(top);
Blog.toc.actived(top);
}, false);
if (w.BLOG.SHARE) {
Blog.share()
}
if (w.BLOG.REWARD) {
Blog.reward()
}
Blog.noop = noop;
Blog.even = even;
Blog.$ = $;
Blog.$$ = $$;
Object.keys(Blog).reduce(function (g, e) {
g[e] = Blog[e];
return g
}, w.BLOG);
if (w.Waves) {
Waves.init();
Waves.attach('.global-share li', ['waves-block']);
Waves.attach('.article-tag-list-link, #page-nav a, #page-nav span', ['waves-button']);
} else {
console.error('Waves loading failed.')
}
})(window, document);

File diff suppressed because one or more lines are too long

View File

@ -1,141 +0,0 @@
(function () {
var G = window || this,
even = G.BLOG.even,
$ = G.BLOG.$,
searchIco = $('#search'),
searchWrap = $('#search-wrap'),
keyInput = $('#key'),
back = $('#back'),
searchPanel = $('#search-panel'),
searchResult = $('#search-result'),
searchTpl = $('#search-tpl').innerHTML,
JSON_DATA = (G.BLOG.ROOT + '/content.json').replace(/\/{2}/g, '/'),
searchData;
function loadData(success) {
if (!searchData) {
var xhr = new XMLHttpRequest();
xhr.open('GET', JSON_DATA, true);
xhr.onload = function () {
if (this.status >= 200 && this.status < 300) {
var res = JSON.parse(this.response);
searchData = res instanceof Array ? res : res.posts;
success(searchData);
} else {
console.error(this.statusText);
}
};
xhr.onerror = function () {
console.error(this.statusText);
};
xhr.send();
} else {
success(searchData);
}
}
function tpl(html, data) {
return html.replace(/\{\w+\}/g, function (str) {
var prop = str.replace(/\{|\}/g, '');
return data[prop] || '';
});
}
var noop = G.BLOG.noop;
var root = $('html');
var Control = {
show: function () {
G.innerWidth < 760 ? root.classList.add('lock-size') : noop;
searchPanel.classList.add('in');
},
hide: function () {
G.innerWidth < 760 ? root.classList.remove('lock-size') : noop;
searchPanel.classList.remove('in');
}
};
function render(data) {
var html = '';
if (data.length) {
html = data.map(function (post) {
return tpl(searchTpl, {
title: post.title,
path: (G.BLOG.ROOT + '/' + post.path).replace(/\/{2,}/g, '/'),
date: new Date(post.date).toLocaleDateString(),
tags: post.tags.map(function (tag) {
return '<span>#' + tag.name + '</span>';
}).join('')
});
}).join('');
} else {
html = '<li class="tips"><i class="icon icon-coffee icon-3x"></i><p>Results not found!</p></li>';
}
searchResult.innerHTML = html;
}
function regtest(raw, regExp) {
regExp.lastIndex = 0;
return regExp.test(raw);
}
function matcher(post, regExp) {
return regtest(post.title, regExp) || post.tags.some(function (tag) {
return regtest(tag.name, regExp);
}) || regtest(post.text, regExp);
}
function search(e) {
var key = this.value.trim();
if (!key) {
return;
}
var regExp = new RegExp(key.replace(/[ ]/g, '|'), 'gmi');
loadData(function (data) {
var result = data.filter(function (post) {
return matcher(post, regExp);
});
render(result);
Control.show();
});
e.preventDefault();
}
searchIco.addEventListener(even, function () {
searchWrap.classList.toggle('in');
keyInput.value = '';
searchWrap.classList.contains('in') ? keyInput.focus() : keyInput.blur();
});
back.addEventListener(even, function () {
searchWrap.classList.remove('in');
Control.hide();
});
document.addEventListener(even, function (e) {
if (e.target.id !== 'key' && even === 'click') {
Control.hide();
}
});
keyInput.addEventListener('input', search);
keyInput.addEventListener(even, search);
}).call(this);

View File

@ -1 +0,0 @@
(function(){function t(t){if(r)t(r);else{var e=new XMLHttpRequest;e.open("GET",g,!0),e.onload=function(){if(this.status>=200&&this.status<300){var e=JSON.parse(this.response);r=e instanceof Array?e:e.posts,t(r)}else console.error(this.statusText)},e.onerror=function(){console.error(this.statusText)},e.send()}}function e(t,e){return t.replace(/\{\w+\}/g,function(t){var n=t.replace(/\{|\}/g,"");return e[n]||""})}function n(t){var n="";n=t.length?t.map(function(t){return e(v,{title:t.title,path:(o.BLOG.ROOT+"/"+t.path).replace(/\/{2,}/g,"/"),date:new Date(t.date).toLocaleDateString(),tags:t.tags.map(function(t){return"<span>#"+t.name+"</span>"}).join("")})}).join(""):'<li class="tips"><i class="icon icon-coffee icon-3x"></i><p>Results not found!</p></li>',L.innerHTML=n}function i(t,e){return e.lastIndex=0,e.test(t)}function s(t,e){return i(t.title,e)||t.tags.some(function(t){return i(t.name,e)})||i(t.text,e)}function a(e){var i=this.value.trim();if(i){var a=new RegExp(i.replace(/[ ]/g,"|"),"gmi");t(function(t){var e=t.filter(function(t){return s(t,a)});n(e),w.show()}),e.preventDefault()}}var r,o=window||this,c=o.BLOG.even,l=o.BLOG.$,u=l("#search"),f=l("#search-wrap"),d=l("#key"),p=l("#back"),h=l("#search-panel"),L=l("#search-result"),v=l("#search-tpl").innerHTML,g=(o.BLOG.ROOT+"/content.json").replace(/\/{2}/g,"/"),m=o.BLOG.noop,O=l("html"),w={show:function(){o.innerWidth<760?O.classList.add("lock-size"):m,h.classList.add("in")},hide:function(){o.innerWidth<760?O.classList.remove("lock-size"):m,h.classList.remove("in")}};u.addEventListener(c,function(){f.classList.toggle("in"),d.value="",f.classList.contains("in")?d.focus():d.blur()}),p.addEventListener(c,function(){f.classList.remove("in"),w.hide()}),document.addEventListener(c,function(t){"key"!==t.target.id&&"click"===c&&w.hide()}),d.addEventListener("input",a),d.addEventListener(c,a)}).call(this);

View File

@ -1,3 +0,0 @@
<%- partial('tags', {
title: theme.tags_title + ': '+ page.tag
}) %>

View File

@ -1,34 +0,0 @@
<%- partial('_partial/header', {
title: locals.title || theme.tags_title,
hdClass: 'tags-header'
}) %>
<div class="container body-wrap fade">
<%
if(is_tag()) { %>
<div class="waterfall">
<% page.posts.each(function(post){ %>
<%- partial('_partial/archive', {post: post, date_format: config.date_format}) %>
<% }) %>
</div>
<% } else {
site.tags.each(function(tag){
if(tag.length){
%>
<h3 class="archive-separator" id="tag-<%=tag.name %>"><%=tag.name %></h3>
<div class="waterfall">
<% tag.posts.each(function(post){ %>
<%- partial('_partial/archive', {post: post, date_format: config.date_format}) %>
<% }) %>
</div>
<% }
})
}
%>
<%- partial('_partial/paginator') %>
</div>