前言

Hexo-Butterfly-Theme,一款比较新而且界面美观的主题。

Hexo:

Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.

Butterfly-Theme:
https://github.com/jerryc127/hexo-theme-butterfly

How to use Hexo

准备工作

在安装前,须检查电脑中是否已安装下列应用程序:

如果已经安装上述必备程序,接下来只需要使用 npm 即可完成 Hexo 的安装。

1
$ npm install -g hexo-cli

如果尚未安装所需要的程序,请根据以下安装指示完成安装。

安装 Git

  • Windows:下载并安装 git.
  • Mac:使用 Homebrew, MacPortsbrew install git;或下载 安装程序 安装。
  • Linux (Ubuntu, Debian):sudo apt-get install git-core
  • Linux (Fedora, Red Hat, CentOS):sudo yum install git-core

安装 Node.js

安装 Node.js 的最佳方式是使用 nvm

cURL:

1
$ curl https://raw.github.com/creationix/nvm/master/install.sh | sh

Wget:

1
$ wget -qO- https://raw.github.com/creationix/nvm/master/install.sh | sh

安装完成后,重启终端并执行下列命令即可安装 Node.js。

1
$ nvm install stable

安装 Hexo

必备的应用程序安装完成后,即可使用 npm 安装 Hexo。

1
$ npm install -g hexo-cli

用法

1
2
3
4
5
6
7
8
9
$ hexo init #初始化一个项目
$ hexo new page "xxx" #生成页面
$ hexo new "" #生成文章
$ hexo clean #清除缓存
$ hexo g #保存修改,生成文件
$ hexo s #启动本地服务
$ hexo d #发布到远程
$ npm install --save xxx #安装插件
$ npm unstall xxx #卸载插件

新建一个文件夹后初始化一个项目,之后的按照 Butterly-theme 主题下的官方文档一步步来就可以了。

创建题目

1
2
hexo new "文章标题" --path learning/coding/文件名 --category 分类名