0
点赞
收藏
分享

微信扫一扫

Hexo Fluid主题 细节优化


一、版权声明优化

需要调整的文件位置, 如图:

Hexo Fluid主题 细节优化_自定义

在​​post.ejs​​​搜索​​copyright​​, 对应的代码段如下图:

Hexo Fluid主题 细节优化_ico_02

将其注释掉, 然后修改为下面的代码

<% if(theme.post.copyright.enable && theme.post.copyright.content && page.copyright !== false) { %><p class="note note-warning">
<strong>本文作者: </strong><a href="<%- url_for() %>"><%- theme.about.name || config.author || config.title %></a> <br>
<strong>本文链接: </strong><a href="<%- full_url_for(page.path) %>"><%- full_url_for(page.path) %></a> <br>
<strong>版权声明: </strong><%- theme.post.copyright.content %>
</p>
<% } %>

最终显示效果:

Hexo Fluid主题 细节优化_ico_03

二、Tag的使用

Hexo Fluid主题 细节优化_1024程序员节_04

测试内容

三、页脚优化

修改页脚内容代码文件位置:

Hexo Fluid主题 细节优化_ico_05

本人代码详情如下内容:

<footer class="text-center mt-5 py-3">

<%- theme.footer.content %>
<!-- 添加网站运行时间 -->
<div class="footer-content">
<div>
<span id="timeDate">载入天数...</span>
<span id="times">载入时分秒...</span>
<script>
var now = new Date();
function createtime(){
var grt= new Date("04/03/2020 00:00:00");//此处修改你的建站时间或者网站上线时间
now.setTime(now.getTime()+250);
days = (now - grt ) / 1000 / 60 / 60 / 24;
dnum = Math.floor(days);
hours = (now - grt ) / 1000 / 60 / 60 - (24 * dnum);
hnum = Math.floor(hours);
if(String(hnum).length ==1 ){
hnum = "0" + hnum;
}
minutes = (now - grt ) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum);
mnum = Math.floor(minutes);
if(String(mnum).length ==1 ){
mnum = "0" + mnum;
}
seconds = (now - grt ) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum);
snum = Math.round(seconds);
if(String(snum).length ==1 ){
snum = "0" + snum;
}
document.getElementById("timeDate").innerHTML = "🚀  "+dnum+" 天"; //此次自定义显示内容
document.getElementById("times").innerHTML = hnum + " 小时 " + mnum + " 分 " + snum + " 秒";
} //此次自定义显示内容
setInterval("createtime()",250);
</script>
</div>
</div>
<!-- 统计访问量信息 -->
<%- partial('_partial/statistics.ejs') %>
<!-- 个人和备案信息 -->
<div>©2020-2021<a href="javascript:void(0)">ClearlightY</a> <a href="http://beian.miit.gov.cn/">冀ICP备19019307号-2</a></div>
<!-- <%- partial('_partial/beian.ejs') %> -->
<% if(theme.web_analytics.cnzz) { %>
<!-- cnzz Analytics Icon -->
<span id="cnzz_stat_icon_<%- theme.web_analytics.cnzz %>" style="display: none"></span>
<% } %>
</footer>

<!-- SCRIPTS -->
<%- partial('_partial/scripts.ejs') %>

Hexo Fluid主题 细节优化_自定义_06

参考文章:

  • ​​Hexo’s Fluid 主题私人定制(持续更新)​​


举报

相关推荐

0 条评论