Hexo is a fast, concise, and efficient blogging framework that leverages the super-fast generation speed of Node.js to render hundreds of pages instantly in seconds. It supports all of the GitHub Markdown features and even integrates most of Octopress’s plugins. Deploy to GitHub Pages, Heroku or other platforms with a single command. Powerful apis can be easily integrated with several template engines (EJS, Pug, Nunjucks) and tools (Babel, PostCSS, Less/Sass).

The installation

Installing Hexo is fairly simple, just install Node.js and Git and run the following command:

$ npm install hexo-cli -g
Copy the code

site

After installing Hexo, execute the following command and Hexo will create the required files in the specified folder.

$ hexo init <folder>
$ cd <folder>
$ npm install
Copy the code

configuration

In the _config.yml file is the configuration information for the site, where you can configure most of the parameters.

The command

new

$ hexo new <title>
Copy the code

The above command creates a source/about/<title>.md file, enclosed in quotes if the title contains Spaces.

server

$ hexo server
Copy the code

Start the server. By default, the url is http://localhost:4000/

deploy

$ hexo deploy
Copy the code

Deploy the site. This command can be abbreviated as:

$ hexo d
Copy the code

The deployment of

Hexo provides quick and easy one-click deployment capabilities that allow web sites to be deployed to a server with a single command.

hexo deploy
Copy the code

Before you can start, you must install hexo-deployer-git

$ npm install hexo-deployer-git --save
Copy the code

Then modify the _config.yml configuration

deploy:
  type: git
  repo: <repository url>
  branch: [branch]
Copy the code

You can then execute the following command to generate the site file and push it to the remote library.

$ hexo clean && hexo deploy
Copy the code