前言
*如果你的hexo博客网页上想要一个精美的live2d看板娘,可以看我接下来的教程了(没有难度,可能需要你有魔法,当然你前置需要有hexo才行)
我使用的是hexo-oh-my-live2d,之所以选用这个的原因是该项目目前正在被积极维护,可支持 所有版本 的live2d模型,之前流行的hexo-helper-live2d由于不在维护了,所以支持的模型较少,这里就不
hexo-oh-my-live2d
仓库地址:hexo-oh-my-live2d 一个用于 hexo 的 live2d 看板娘插件,支持所有版本的模型。)
安装
1.在hexo根目录下执行下面的操作
yarn add hexo-oh-my-live2d --save
2.在hexo的config.yml文件下添加下面的内容,我这里使用的是cdn,如果你想要像我一样使用自己的模型,你需要在github上建一个仓库,然后使用cdn代理一下,下面会写到如何cdn代理,先看一下我的配置文件
# live2d看板娘
OhMyLive2d:
enable: true
CDN: https://registry.npmmirror.com/oh-my-live2d/latest/files
# CDN: https://registry.npmmirror.com/oh-my-live2d/0.13/files/dist/index.min.js
option:
# importType: 'cubism2' # 导入类型, 默认使用全量导入: complete , 可选值: complete, cubism2, cubism5
libraryUrls: # 自定义 Cubism SDK 外部资源地址
complete: https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/complete.js
cubism2: https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism2.js
cubism5: https://registry.npmmirror.com/oh-my-live2d/latest/files/lib/cubism5.js
# menus:
# items: |
# (defaultItems)=>{
# return [
# ...defaultItems,
# {
# id: 'github',
#