This commit is contained in:
Van 2019-03-22 16:45:30 +08:00
parent 1121ffae30
commit 53f713a45d
No known key found for this signature in database
GPG Key ID: 7059B8783A78F16C
7 changed files with 672 additions and 621 deletions

View File

@ -30,7 +30,7 @@
<main class="main"> <main class="main">
<div class="wrapper"> <div class="wrapper">
<div class="content page-archive"> <div class="content page-archive">
<section class="posts-collapse"> <section class="posts-collapse posts-collapse--line">
<span class="archive-move-on"></span> <span class="archive-move-on"></span>
<span class="archive-page-counter"> <span class="archive-page-counter">
${ohLabel}..! ${sumLabel} ${statistic.statisticPublishedBlogArticleCount} ${fightLabel} ${ohLabel}..! ${sumLabel} ${statistic.statisticPublishedBlogArticleCount} ${fightLabel}

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -18,29 +18,40 @@
--> -->
<footer class="footer"> <footer class="footer">
<div class="wrapper fn-clear"> <div class="wrapper">
<a href="${servePath}">${blogTitle}</a> • <div class="fn-clear">
${onlineVisitor1Label}${onlineVisitorCnt} <br/> <a href="${servePath}">${blogTitle}</a> •
&copy; ${year} ${onlineVisitor1Label}${onlineVisitorCnt}
<div class="fn-right">
<#include "../../common-template/macro-user_site.ftl"/>
<@userSite dir="n"/>
</div>
</div>
<div class="fn-clear">
&copy; ${year}
${footerContent} ${footerContent}
Powered by <a href="https://b3log.org" target="_blank">B3log 开源</a> • Powered by <a href="https://b3log.org" target="_blank">B3log 开源</a> •
<a href="https://solo.b3log.org" target="_blank">Solo</a> ${version} <a href="https://solo.b3log.org" target="_blank">Solo</a> ${version}
<div class="fn-right"> <div class="fn-right">
Theme <a rel="friend" href="https://github.com/b3log/solo-skins" target="_blank">${skinDirName}</a> Theme <a rel="friend" href="https://github.com/b3log/solo-skins" target="_blank">${skinDirName}</a>
<sup>[<a href="https://github.com/iissnan/hexo-theme-next" target="_blank">ref</a>]</sup> <sup>[<a href="https://github.com/iissnan/hexo-theme-next" target="_blank">ref</a>]</sup>
by <a href="http://vanessa.b3log.org" target="_blank">Vanessa</a> by <a href="http://vanessa.b3log.org" target="_blank">Vanessa</a>
</div>
</div> </div>
</div> </div>
</footer> </footer>
<div class="back-to-top" onclick="Util.goTop()"></div> <div class="back-to-top" onclick="Util.goTop()"></div>
<script type="text/javascript" src="${staticServePath}/js/lib/jquery/jquery.min.js" charset="utf-8"></script> <script type="text/javascript" src="${staticServePath}/js/lib/jquery/jquery.min.js" charset="utf-8"></script>
<script type="text/javascript" src="${staticServePath}/js/common${miniPostfix}.js?${staticResourceVersion}" charset="utf-8"></script> <script type="text/javascript" src="${staticServePath}/js/common${miniPostfix}.js?${staticResourceVersion}"
<script type="text/javascript" src="${staticServePath}/skins/${skinDirName}/js/${skinDirName}${miniPostfix}.js?${staticResourceVersion}" charset="utf-8"></script> charset="utf-8"></script>
<script type="text/javascript"
src="${staticServePath}/skins/${skinDirName}/js/${skinDirName}${miniPostfix}.js?${staticResourceVersion}"
charset="utf-8"></script>
<#include "../../common-template/label.ftl"> <#include "../../common-template/label.ftl">
<script type="text/javascript"> <script type="text/javascript">
Label.tocLabel = "${tocLabel}"; Label.tocLabel = "${tocLabel}"
Label.siteViewLabel = "${siteViewLabel}"; Label.siteViewLabel = "${siteViewLabel}"
</script> </script>
${plugins} ${plugins}

View File

@ -76,7 +76,7 @@ var NexT = {
'top': '0' 'top': '0'
}, function () { }, function () {
// 当有文章页面有目录时,回调不放这里,侧边栏就会一片空白 // 当有文章页面有目录时,回调不放这里,侧边栏就会一片空白
if ($('.b3-solo-list li').length > 0 && $(window).width() > 1000) { if ($('.article__toc li').length > 0 && $(window).width() > 1000) {
$('.sidebar-toggle').click(); $('.sidebar-toggle').click();
} }
}); });
@ -92,54 +92,18 @@ var NexT = {
}); });
}, },
initArticle: function () { initArticle: function () {
if ($('.b3-solo-list li').length > 0 && $(window).width() > 1000) { if ($('.article__toc li').length > 0 && $(window).width() > 1000) {
// add color to sidebar menu // add color to sidebar menu
$('.sidebar-toggle').addClass('has-toc'); $('.sidebar-toggle').addClass('has-toc');
// append toc to sidebar menu
var articleTocHTML = '<ul><li class="current" data-tab="toc">' + Label.tocLabel + '</li><li data-tab="site">' + Label.siteViewLabel + '</li></ul><section></section>';
$('.sidebar').prepend(articleTocHTML);
var $sectionF = $('.sidebar section:first').html($('.b3-solo-list')),
$sectionL = $('.sidebar section:last');
$sectionF.height($(window).height() - 90);
// 切换 tab
$('.sidebar > ul > li').click(function () {
if ($(this).data('tab') === 'toc') {
$sectionL.animate({
"opacity": '0',
"top": '-50px'
}, 300, function () {
$sectionF.show().css('top', '-50px');
$sectionF.animate({
"opacity": '1',
"top": '0'
}, 300);
});
} else {
$sectionF.animate({
"opacity": '0',
"top": '-50px'
}, 300, function () {
$sectionF.hide().css('top', '-50px');
$sectionL.animate({
"opacity": '1',
"top": '0'
}, 300);
});
}
$('.sidebar > ul > li').removeClass('current');
$(this).addClass('current');
});
this.initToc(); this.initToc();
} }
}, },
initToc: function () { initToc: function () {
var $articleTocs = $('.vditor-reset [id^=b3_solo_h]'), var $articleTocs = $('.vditor-reset [id^=b3_solo_h]'),
$articleToc = $('.b3-solo-list'); $articleToc = $('.article__toc');
$(window).scroll(function (event) { $(window).scroll(function (event) {
if ($('.b3-solo-list li').length === 0) { if ($('.article__toc li').length === 0) {
return false; return false;
} }

2
next/js/next.min.js vendored
View File

@ -1 +1 @@
var NexT={init:function(){$(".sidebar-toggle").click(function(){var i=$(".sidebar");$(this).hasClass("sidebar-active")?($(this).removeClass("sidebar-active"),$("body").animate({"padding-right":0}),i.animate({right:-320}),i.find("section").css("opacity",0)):($(this).addClass("sidebar-active"),$("body").animate({"padding-right":320}),i.animate({right:0},function(){i.find("section:first").animate({opacity:1})}))}),$(".site-nav-toggle").click(function(){$(".site-nav").slideToggle()}),$(document).ready(function(){setTimeout(function(){$(".logo-wrap").css("opacity",1),$(".logo-line-before i").animate({left:"0"},function(){$(".site-title").css("opacity",1).animate({top:0},function(){$(".menu").css("opacity",1).animate({"margin-top":"15px"}),$(".main").css("opacity",1).animate({top:"0"},function(){0<$(".b3-solo-list li").length&&1e3<$(window).width()&&$(".sidebar-toggle").click()})})}),$(".logo-line-after i").animate({right:"0"})},500)})},initArticle:function(){if(0<$(".b3-solo-list li").length&&1e3<$(window).width()){$(".sidebar-toggle").addClass("has-toc");var i='<ul><li class="current" data-tab="toc">'+Label.tocLabel+'</li><li data-tab="site">'+Label.siteViewLabel+"</li></ul><section></section>";$(".sidebar").prepend(i);var t=$(".sidebar section:first").html($(".b3-solo-list")),a=$(".sidebar section:last");t.height($(window).height()-90),$(".sidebar > ul > li").click(function(){"toc"===$(this).data("tab")?a.animate({opacity:"0",top:"-50px"},300,function(){t.show().css("top","-50px"),t.animate({opacity:"1",top:"0"},300)}):t.animate({opacity:"0",top:"-50px"},300,function(){t.hide().css("top","-50px"),a.animate({opacity:"1",top:"0"},300)}),$(".sidebar > ul > li").removeClass("current"),$(this).addClass("current")}),this.initToc()}},initToc:function(){var n=$(".vditor-reset [id^=b3_solo_h]"),l=$(".b3-solo-list");$(window).scroll(function(i){if(0===$(".b3-solo-list li").length)return!1;var t=[];n.each(function(i){t.push({id:this.id,offsetTop:this.offsetTop})});for(var a=$(window).scrollTop(),e=0,o=t.length;e<o;e++)if(a<t[e].offsetTop+200){l.find("li").removeClass("current");var s=0<e?e-1:0;l.find('a[href="#'+t[s].id+'"]').parent().addClass("current");break}a>=t[t.length-1].offsetTop+200&&(l.find("li").removeClass("current"),l.find("li:last").addClass("current"))}),$(window).scroll()}};NexT.init(); var NexT={init:function(){$(".sidebar-toggle").click(function(){var i=$(".sidebar");$(this).hasClass("sidebar-active")?($(this).removeClass("sidebar-active"),$("body").animate({"padding-right":0}),i.animate({right:-320}),i.find("section").css("opacity",0)):($(this).addClass("sidebar-active"),$("body").animate({"padding-right":320}),i.animate({right:0},function(){i.find("section:first").animate({opacity:1})}))}),$(".site-nav-toggle").click(function(){$(".site-nav").slideToggle()}),$(document).ready(function(){setTimeout(function(){$(".logo-wrap").css("opacity",1),$(".logo-line-before i").animate({left:"0"},function(){$(".site-title").css("opacity",1).animate({top:0},function(){$(".menu").css("opacity",1).animate({"margin-top":"15px"}),$(".main").css("opacity",1).animate({top:"0"},function(){0<$(".article__toc li").length&&1e3<$(window).width()&&$(".sidebar-toggle").click()})})}),$(".logo-line-after i").animate({right:"0"})},500)})},initArticle:function(){if(0<$(".article__toc li").length&&1e3<$(window).width()){$(".sidebar-toggle").addClass("has-toc");var i='<ul><li class="current" data-tab="toc">'+Label.tocLabel+'</li><li data-tab="site">'+Label.siteViewLabel+"</li></ul><section></section>";$(".sidebar").prepend(i);var t=$(".sidebar section:first").html($(".article__toc")),a=$(".sidebar section:last");t.height($(window).height()-90),$(".sidebar > ul > li").click(function(){"toc"===$(this).data("tab")?a.animate({opacity:"0",top:"-50px"},300,function(){t.show().css("top","-50px"),t.animate({opacity:"1",top:"0"},300)}):t.animate({opacity:"0",top:"-50px"},300,function(){t.hide().css("top","-50px"),a.animate({opacity:"1",top:"0"},300)}),$(".sidebar > ul > li").removeClass("current"),$(this).addClass("current")}),this.initToc()}},initToc:function(){var n=$(".vditor-reset [id^=b3_solo_h]"),l=$(".article__toc");$(window).scroll(function(i){if(0===$(".article__toc li").length)return!1;var t=[];n.each(function(i){t.push({id:this.id,offsetTop:this.offsetTop})});for(var a=$(window).scrollTop(),e=0,o=t.length;e<o;e++)if(a<t[e].offsetTop+200){l.find("li").removeClass("current");var s=0<e?e-1:0;l.find('a[href="#'+t[s].id+'"]').parent().addClass("current");break}a>=t[t.length-1].offsetTop+200&&(l.find("li").removeClass("current"),l.find("li:last").addClass("current"))}),$(window).scroll()}};NexT.init();

View File

@ -24,6 +24,9 @@
</div> </div>
<aside class="sidebar"> <aside class="sidebar">
<#if article?? && article.articleToC?? && article.articleToC?size &gt; 0>
<#include "../../common-template/toc.ftl"/>
<#else>
<section> <section>
<img class="site-author-image" src="${adminUser.userAvatar}" title="${userName}"/> <img class="site-author-image" src="${adminUser.userAvatar}" title="${userName}"/>
<p class="site-author-name">${userName}</p> <p class="site-author-name">${userName}</p>
@ -108,4 +111,5 @@
</div> </div>
</#if> </#if>
</section> </section>
</#if>
</aside> </aside>