#layouts/partials/footer/custom.html
<!-- Add blog running time --><script>functionupdateTime(){lets1='2022-5-18';// website start date
s1=newDate(s1.replace(/-/g,"/"));lets2=newDate();lettimeDifference=s2.getTime()-s1.getTime();letdays=Math.floor(timeDifference/(1000*60*60*24));lethours=Math.floor((timeDifference%(1000*60*60*24))/(1000*60*60));letminutes=Math.floor((timeDifference%(1000*60*60))/(1000*60));letseconds=Math.floor((timeDifference%(1000*60))/1000);letresult=days+"天"+hours+"小时"+minutes+"分钟"+seconds+"秒";document.getElementById('runningdays').innerHTML=result;}// 每隔一秒钟调用一次updateTime函数
setInterval(updateTime,1000);</script>
1
2
3
4
5
6
#layouts/partials/footer/footer.html
<!-- Add blog running time --><sectionclass="running-time">本博客已稳定运行
<spanid="runningdays"class="running-days"></span></section>
#/layouts/partials/widget/toc.html
widget--toc盒子之后
<ahref="#"id="back-to-top"><imagesrc="/photos/top.png"></image></a>文件最后
<scriptsrc="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script><script>// Check to see if the window is top if not then display button
$(window).scroll(function(){if($(this).scrollTop()){$('#back-to-top').fadeIn();}else{$('#back-to-top').fadeOut();}});// Click event to scroll to top
$('#back-to-top').click(function(){$('html, body').animate({scrollTop:0},1000);returnfalse;});</script>#custom.css
// 返回顶部按钮
$hover: 0.2s ease-in-out;
#back-to-top {
bottom: -60px;
right: 2px;
display: none;
position: absolute;
border: 0;
transition: transform $hover;
&:hover {
transform: translateY(-10px);
}
}