如何在博客中添加看板娘

在浏览博客的时候发现不少站点的Live2D看板娘很有意思,搜了下,针对hexo有个hexo-helper-live2d插件能快速添加,非常方便。

安装

1
2
3
4
5
# 安装hexo插件
npm install hexo-helper-live2d

# 安装模型
npm install live2d-widget-model-haruto

更多模型

配置

在 _config.yml 配置文件中添加如下配置

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
live2d:
enable: true
scriptFrom: local
pluginRootPath: live2d_models/
pluginJsPath: lib/
pluginModelPath: assets/
tagMode: false
log: false
model:
use: live2d-widget-model-haruto
# use: tia
scale: 1

display:
width: 60
height: 120
position: left
hOffset: 0
vOffset: -30
mobile:
show: true
scale: 0.5
react:
opacityDefault: 0.8
opacityOnHover: 0.6

启动服务就可以在最下角看到自己的看板娘了~~~

参考:
hexo-helper-live2d
模型
提取模型

您的支持将鼓励我继续创作!