文章加阴影

  • themes-anatole-source-css-style.css 加上
1
2
3
4
5
6
7
.post {
margin-top: 60px;
margin-bottom: 60px;
padding: 25px;
-webkit-box-shadow: 0 0 5px rgba(202, 203, 203, .5);
-moz-box-shadow: 0 0 5px rgba(202, 203, 204, .5);
}

导航栏自定义

  • themes-anatole-layout-partial-nav.pug
    未来看看还能放点啥东,再来这里放吧
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
li
if is_home()
a.current(href="/")= __('首页')
else
a(href="/")= __('首页')
//- li
//- if is_archive()
//- a.current(href="/archives")= __('文章')
//- else
//- a(href="/archives")= __('文章')
li
a(href="http://www.tomyself.top/" target="_blank")=__('日志')
li
if is_current('about')
a.current(href="/about")= __('关于')
else
a(href="/about")= __('关于')

修改footer

顺便还学了下 pug

  • 对于站点totalcount,需要Hexo-WordCount的插件
1
npm i --save hexo-wordcount

这款插件还能显示文章字数、阅读时长等等,具体使用看官方文档

  • 修改Footer
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
.footer
.copright
- var current = date(Date.now(), "2014-YYYY")
span ©
span= current
a(href="https://www.zhzh.xyz/") 震朕的小宇宙
span Theme by CaiCai & Ben
.count
script(src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js")
i(class="fa fa-user")
span.site-uv 访问用户:
span(id="busuanzi_value_site_uv")
span 人 |
span.site-uv
i(class="fa fa-eye")
span 访问次数:
span(id="busuanzi_value_site_pv")
span 次 |
span.site-pv
i(class="fa fa-pencil")
span 博客全站:
span(class="post-count")= totalcount(site)
span 字

修改滚动条样式

在style.css里面加入滚动条样式代码,用的还是诌给自己的滚动条渐变代码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/*定义滚动条高宽及背景 高宽分别对应横竖滚动条的尺寸*/
body::-webkit-scrollbar
{
width: 10px;
height: 5px;
background-color: #F5F5F5;
}

/*定义滚动条轨道 内阴影+圆角*/
body::-webkit-scrollbar-track
{
border-radius: 10px;
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,.3);
box-shadow: inset 0 0 6px rgba(0,0,0,.3);
}

/*定义滑块 内阴影+圆角*/
body::-webkit-scrollbar-thumb
{
border-radius: 10px;
background: linear-gradient(to bottom, #3690cf, #17decf);
}

添加社交账号

  • _config.yml
    加入自己的账号名称
  • sidebar.pug
    新建标签页打开
1
2
3
4
if theme.weibo
li
a(href="http://weibo.com/" + theme.weibo target="_blank")
i.fa.fa-weibo

添加RSS

  • 安装RSS插件
1
npm install hexo-generator-feed
  • Blog工程目录下的_config.xml
1
2
3
4
5
6
7
8
# Extensions
plugins:
hexo-generator-feed
#Feed Atom
feed:
type: atom
path: zhzhrss.xml
limit: 30
  • 生成RSS
1
hexo g
  • 在theme下的文件下设置路径
1
2
3
4
5
6
7
# Social Accounts
twitter:
rss: zhzhrss.xml
weibo: 219904012
instagram:
github: zhouzaihang
facebook:
  • 修改下链接打开方式
1
2
3
4
if theme.rss
li
a(href= url_for(theme.rss) target="_blank")
i.fa.fa-rss