hexo右下角添加2d动画模型

hexo右下角添加2d动画模型

  1. 安装插件
    1
    npm install --save hexo-helper-live2d
  2. 选择你喜欢的模型名字
    在GitHub上live2dDemo有很多,可以选择里面的模型
  3. 将以下代码添加到主题配置文件_config.yml末尾,修改<你喜欢的模型名字>(如:z16):
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    live2d:
    enable: true
    scriptFrom: local
    pluginRootPath: live2dw/
    pluginJsPath: lib/
    pluginModelPath: assets/
    tagMode: false
    log: false
    model:
    use: live2d-widget-model-<你喜欢的模型名字>
    display:
    position: right
    width: 150
    height: 300
    mobile:
    show: true
  4. 建配置文件
    1
    2
    3
    在站点目录下建文件夹live2d_models,
    再在live2d_models下建文件夹<你喜欢的模型名字>,
    再在<你喜欢的模型名字>下建json文件:<你喜欢的模型名字>.model.json
  5. 安装模型
    1
    npm install --save live2d-widget-model-<你喜欢的模型名字>
  6. 运行以下命令, 在http://localhost:4000/查看测试结果
    1
    hexo clean && hexo g && hexo s