NexT主题修改圆角头像

修改圆角头像之前应先将头像开关打开,编辑主题配置文件next/_config.yml,修改字段avatar,值设置成头像的链接地址。其中,头像的链接地址可以是:

地址
完整的互联网 URIhttps://wx4.sinaimg.cn/large/006btIwUly1frlbyhddakj30zk0zkkjm.jpg
站点内的地址

将头像放置主题目录下的 source/uploads/ (新建 uploads 目录若不存在)<配置为:avatar: /uploads/avatar.png

或者放置在source/images/目录下
配置为:avatar: /images/avatar.png

然后在 \themes\next\source\css_common\components\sidebar\sidebar-author.styl 里添加如下代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
.site-author-image {
display: block;
margin: 0 auto;
padding: $site-author-image-padding;
max-width: $site-author-image-width;
height: $site-author-image-height;
border: $site-author-image-border-width solid $site-author-image-border-color;

/* 头像圆形 */
border-radius: 80px;
-webkit-border-radius: 80px;
-moz-border-radius: 80px;
box-shadow: inset 0 -1px 0 #333sf;
}
.site-author-image{
display: block;
margin: 0 auto;
padding: 2px;
max-width: 120px;
height: auto;
border: 1px solid #eee;
opacity: 1
}
.site-author-image{
border-radius:70%;
padding:2px;
border:1px solid #eee;
animation:cycle 1s .5s forwards;
transition:border-radius 2s
}
.site-author-image:hover{
border-radius:0;
border:1px solid #eee
}

-------------本文结束感谢您的阅读-------------