Hexo is a fast, simple and powerful blog framework based on Node.js.
This blog is written in Markdown, using Hexo and GitHub Pages due to following reasons.
- Support Markdown, allow you to post easily.
- Free hosting from GitHub Pages.
- Users are able to use a wide variety of Themes.
Hexo requires couple of things installed on your machine to run.
If you already installed these, you can skip to Hexo installation
- Windows: Download & install git.
- Mac: Install it with Homebrew, MacPorts or installer.
- Linux (Ubuntu, Debian):
sudo apt-get install git-core
- Linux (Fedora, Red Hat, CentOS):
sudo yum install git-core
The best way to install Node.js is with Node Version Manager.
Thankfully the creators of nvm provide a simple script that automatically installs nvm:
$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
$ wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
Once nvm is installed, restart the terminal and run the following command to install Node.js:
$ nvm install stable
Alternatively, download and run the installer.
Once all the requirements are installed, you can install Hexo with npm:
$ npm install -g hexo-cli
$ npm install hexo-deployer-git --save
After installing Hexo, you can set up a new folder for your blog.
$ hexo init <blog_folder_name>
$ cd <blog_folder_name>
$ npm install
├── _config.yml : configuration file for blog
├── package.json : list of packages in json format
├── scaffolds : scaffolds folder make you able to set up initial seed for post or drafts
├── source : source folder to store markdown files and all other files for blogging
| ├── _drafts
| └── _posts
└── themes : folder to store themes, hexo generate blog based on files in source, and format them with themes
After installing, you can run local server to test Hexo
$ hexo server
You can check your server at
localhost:4000 (default port: 4000)
Create a new post
$ hexo new "My New Post"
Generate static files
$ hexo generate
$ hexo g
$ hexo deploy
$ hexo d
You can fine more commands in this Link.