Hexo Blog 搭建

准备

按照官网安装即可。

配置

初始化blog

1
$ hexo init cn-dream

下载 next 主题

1
2
3
$ cd cn-dream/themes/
$ git clone https://github.com/iissnan/hexo-theme-next.git
$ cd hexo-theme-next

配置cn-dream/_config.yml

由于 next主题 使用的配置是 zh-Hans.yml配置文件,修改如下行

1
2
lang: zh-Hans
theme: hexo-theme-next

配置cn-dream/theme/hexo-theme-next/_config.yml

配置 favicon.ico,以及用户头像,复制对应文件到cn-dream/source目录

1
2
favicon: /favicon.ico
avatar: /uploads/avatar.jpg

安装markdown绘图插件mermaid

1
$ npm install hexo-tag-mermaid --save

然后,在cn-dream/theme/hexo-theme-next/layout/_custom/header.swing 加入

1
2
3
<script src="//cdn.bootcss.com/mermaid/6.0.0/mermaid.min.js"></script>
<link rel="stylesheet" type="text/css"
href="https://cdn.bootcss.com/mermaid/6.0.0/mermaid.min.css">

参考