236 字
1 分钟
Next 1 设置头像
准备工作
首先准备一张你的头像图片,格式无所谓,官方是支持 gif 动图的,个人推荐先把突破裁剪成正方形。
我这里准备的就是一张 png 格式的正方形图片,作为我的头像。

将图片上传到你的项目中 source/images
,也可以放在 theme/next/source/images
。
配置文件
打开,并修改 next 主题的配置文件:
vim theme/next/_config.yml
可以参考我的配置:
# Sidebar Avataravatar: # Replace the default image and set the url here. url: /images/avatar.png #/images/avatar.gif # If true, the avatar will be displayed in circle. rounded: true # If true, the avatar will be rotated with the cursor. rotated: true
参数 | 详细 |
---|---|
url | 图像的路径 |
rounded | true:让头像显示在一个圆形空间中 |
rotated | true:鼠标点在图像上会转 |
最终效果展示: