Hexo使用

安装Node.js

  1. 安装最新版npm
1
npm install npm@latest -g
  1. 安装n
1
npm install -g n
  1. 使用n安装node
1
2
3
n latest
n stable
n lts

安装Hexo

1
cnpm install -g hexo-cli

使用Hexo建站

在建站博客根目录中(./hexo)中初始化

1
2
3
hexo init hexo
cd hexo
npm install

安装next主题(仓库地址)

1
git clone https://github.com/theme-next/hexo-theme-next themes/next

在博客根目录下的_config.yml中配置

1
theme: next

安装看板娘

  1. 安装live2d模块
1
npm install --save hexo-helper-live2d
  1. 下载模型(仓库地址

    在您博客根目录下创建一个 live2d_models 文件夹,将模型资源文件夹(如:live2d-widget-model-koharu)放入此文件夹中

  2. 在博客根目录下的_config.yml文件进行配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# Live2D
## https://github.com/EYHN/hexo-helper-live2d
live2d:
enable: true
# enable: false
pluginRootPath: live2dw/ # Root path of plugin to be on the site (Relative)
pluginJsPath: lib/ # JavaScript path related to plugin's root (Relative)
pluginModelPath: assets/ # Relative model path related to plugin's root (Relative)
scriptFrom: local # Default
# scriptFrom: jsdelivr # jsdelivr CDN
# scriptFrom: unpkg # unpkg CDN
# scriptFrom: https://cdn.jsdelivr.net/npm/live2d-widget@3.x/lib/L2Dwidget.min.js # Your custom url
tagMode: false # Whether only to replace live2d tag instead of inject to all pages
log: false # Whether to show logs in console
model:
use: live2d-widget-model-koharu # npm-module package name
# use: wanko # folder name in (hexo base dir)/live2d_models/
# use: ./wives/wanko # folder path relative to hexo base dir
# use: https://cdn.jsdelivr.net/npm/live2d-widget-model-wanko@1.0.5/assets/wanko.model.json # Your custom url