这是博主自己添加的,可能存在小瑕疵,有需求自行参考修改,也可以提供宝贵的建议O(∩_∩)O

效果预览
示例源码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#footer-wrap
if theme.footer.owner.enable
- var grt= new Date(theme.footer.se_time) //在此处修改你的建站时间
- var now = new Date()
- var nowYear = now.getFullYear()
- var days = (now - grt ) / 1000 / 60 / 60 / 24
- var dnum = Math.floor(days)
if theme.footer.owner.since && theme.footer.owner.since != nowYear
.copyright!= `©${theme.footer.owner.since} - ${nowYear} By ${config.author}`
else
.copyright!= `©${nowYear} By ${config.author}`
if theme.footer.copyright
.framework-info
span= _p('Copyright') + ' '
a(href='https://hexo.io')= 'Lucky'
span.footer-separator |
span= _p('footer.theme') + ' '
a(href='https://github.com/jerryc127/hexo-theme-butterfly')= 'Butterfly'
if theme.footer.custom_text
.footer_custom_text!=`${theme.footer.custom_text} ${dnum} 天`

在_config.butterfly.yml中配置

1
2
3
footer:
custom_text: '小站已运行'
se_time: '2022-11-03T12:00:00Z'