236 字
1 分钟
Next 1 设置头像
2021-12-14

准备工作#

首先准备一张你的头像图片,格式无所谓,官方是支持 gif 动图的,个人推荐先把突破裁剪成正方形。

我这里准备的就是一张 png 格式的正方形图片,作为我的头像。

将图片上传到你的项目中 source/images,也可以放在 theme/next/source/images

配置文件#

打开,并修改 next 主题的配置文件:

Terminal window
vim theme/next/_config.yml

可以参考我的配置:

# Sidebar Avatar
avatar:
# 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图像的路径
roundedtrue:让头像显示在一个圆形空间中
rotatedtrue:鼠标点在图像上会转

最终效果展示:

Next 设置头像

Next 1 设置头像
https://fuwari.vercel.app/posts/建站/hexo/next-1-设置头像/
作者
Asuwee
发布于
2021-12-14
许可协议
CC BY-NC-SA 4.0