Hexo+Github

0x01 Installing Hexo is quite easy:

Node.js

https://nodejs.org/dist/v8.6.0/node-v8.6.0-x64.msi

Git

https://git-scm.com/download/win

install Hexo

$ npm install -g hexo-cli

0x02:

1
Once Hexo is installed, run the following commands to initialise Hexo in the target <folder>.
  • 说明:不要在c盘右键执行‘Git Bash Here ’,因为下面init时会有权限问题。
1
2
3
$ hexo init <folder>
$ cd <folder>
$ npm install

Once initialised, here’s what your project folder will look like:
.
├── _config.yml
├── package.json
├── scaffolds
├── source
| ├── _drafts
| └── _posts
└── themes
_config.yml

发布博文

  • 在MyBlog目录下执行:hexo new “我的第一篇文章”,会在source->_posts文件夹内生成一个.md文件。
  • 编辑该文件(遵循Markdown规则)
  • 修改起始字段
  • title 文章的标题
  • date 创建日期 (文件的创建日期 )
  • updated 修改日期 ( 文件的修改日期)
  • comments 是否开启评论 true
  • tags 标签
  • categories 分类
  • permalink url中的名字(文件名)
  • 编写正文内容(MakeDown)
  • hexo clean 删除本地静态文件(Public目录),可不执行。
  • hexo g 生成本地静态文件(Public目录)
  • hexo deploy 将本地静态文件推送至github(hexo d)

自定义信息

\MyBlog_config.yml
Site
title: kk98kk0
subtitle:
description:
author: kk98kk0
language: zh-Hans
timezone:

自定义主题:

到目录\MyBlog\themes\

git clone https://github.com/iissnan/hexo-theme-next.git
修改目录方便使用
菜单修改 \MyBlog\themes\next_config.yml
menu:
home: / || home
about: /about/ || user
tags: /tags/ || tags
categories: /categories/ || th
archives: /archives/ || archive
schedule: /schedule/ || calendar
sitemap: /sitemap.xml || sitemap
commonweal: /404/ || heartbeat