(一). 本地安装node.js 6.x版本以上(这里默认已安装nodejs官方下载链接)。
(二). 本地安装git git下载链接。
- 安装cnpm,国内淘宝镜像
npm install -g cnpm --registry=https://registry.npm.taobao.org
卸载:
sudo npm uninstall cnpm -g
- 安装hexo
sudo cnpm install hexo-cli -g
卸载:
sudo cnpm uninstall hexo-cli -g
- 初始化hexo项目
sudo hexo init
- 构建hexo项目
sudo hexo generate
- 启动hexo服务
sudo hexo server
- 清理hexo构建项目
sudo hexo clean
- 下载yilia主题
git clone https://github.com/litten/hexo-theme-yilia.git themes/yilia
- 配置根目录下_config.yml
theme: yilia
- 为了显示全目录,项目根目录下安装jsoncontent插件
sudo cnpm i hexo-generator-json-content --save
- 配置项目根目录下的_config.yml
jsonContent:
meta: false
pages: false
posts:
title: true
date: true
path: true
text: false
raw: false
content: false
slug: false
updated: false
comments: false
link: false
permalink: false
excerpt: false
categories: false
tags: true
- 安装deploy插件
sudo cnpm install hexo-deployer-git --save
- github上新建仓库,名称必须是
github账户名.github.io
- 配置根目录下的_config.yml
deploy:
type: git
repo: https://github.com/github账户名/github账户名.github.io
branch: master
- 发布
sudo hexo deploy
- 切换到项目根目录
cd blog
- 安装package记录的相关插件
sudo cnpm install --save
- 安装插件
sudo cnpm install --save hexo-helper-live2d
- 安装模型
sudo cnpm install live2d-widget-model-hibiki