Hexo 安装与配置
0. 安装前提 Windows系统下安装 Hexo,需要先安装下列应用程序。 node.js git 1. 安装、初始化 Hexo 123456 $ npm install -g hexo-cli# 创建博客主文件夹为: hexo$ hexo init hexo$ cd hexo$ npm install 创建新 post,新建的 post 文件位于 source/_posts 文件夹内。 1 $ hexo new "My New Post" 2. 服务器 首先安装hexo-server,运行服务器。 12 $ npm install hexo-server --save$ hexo server 网站会在 http://localhost:4000 下启动。 3. 更换主题 在终端窗口下,定位到 Hexo 站点目录下。使用 Git checkout 主题代码。 12 $ cd hexo$ git clone https://github.com/theme-next/hexo-theme-next themes/next 打开站点配置文件 blog/_config.yaml ,找到 theme 字段,并将其值更改为 next。 1 theme: next 运行服务器,验证主题是否正确启用。 12 $ hexo clean$ hexo server 3.1 主题配置