Build GitHub static blog


Minimalist style blog = windows + hexos + GitHub
This is the finished map of this tutorial

Build GitHub static blog

Blog building is divided into three steps:

  • Create GitHub domain name and space
  • Git, nodejs, hexo download and installation
  • Configuration environment

1. Create GitHub domain name and space

Enter GitHub official website, register and log in.
After logging in, click the “+” sign in the upper right corner and select “new repository”, the following interface will appear:

Build GitHub static blog

Fill in in repository name. (username refers to the user name of the previous owner. For example, I should fill in here.)
Then click Create repository at the bottom.
2. Install git, nodejs, hexo
Download address:
Download on git official website:
Download on nodejs official website:
The above two tools are directly downloaded exe files. Click Install. After installation, right click in the folder and you will see a git bash in the drop-down menu. This is a terminal similar to liunx, which can simulate the operation of the terminal under Linux.
You cannot install hexo until GIT and nodejs are installed. The installation of hexo is very simple. You only need to enter the following command in the command prompt (CMD).

npm install -g hexo-cli

3. Configuration environment
3.1 configure SSH
Open git Bash and execute the following command to generate SSH access private key and public key.

ssh-keygen -t rsa -C "[email protected]"

After entering the command, you will be prompted to enter something, regardless. Just keep going back to the end. Then you will generate two files id_rsa and under the ~ /. SSH file.

Build GitHub static blog

Open GitHub – > setting – > SSH keys. Then click New SSH key to create a new SSH key. Copy and paste all contents in the file under the key. Then use the following command to test whether you can connect to GitHub

ssh -T [email protected]

3.2 write configuration and publish blog
3.2.1 theme installation
Create a new folder to store blogs

hexo init [email protected]

Install the theme. Next is recommended. You can choose other topics.

cd [email protected]
git clone themes/next

3.2.2 user defined configuration file
Open / _config.yml, and modify the following key value pairs (note that there must be a space after the colon):

title: GA-17's Blog
description: Hello World!
author: GA-17
language: zh-Hans
theme: next
  type: git
  branch: master

3.2.3 configuration completed, write article!!!
Create your first blog under posts. For example, create a file named in markdown format, and save it.

title: My First Blog

Our blog has been set up!!

3.2.4 release
Install the hexo deployer git auto deployment publishing tool

 npm install hexo-deployer-git --save

Publish blog

hexo clean && hexo g && hexo d

#Hexo clean clear cache
#Hexo g generates static pages
#Hexo s start service Preview
#Hexo d starts deployment

If this is the first time to log in, the terminal will let you enter GitHub’s email and password. After you enter it correctly, your blog will be uploaded to GitHub. In the future, you can execute this command after you write your blog.
At this point, the blog building is completed. Go to to see your blog!!!

Recommended Today

Configure Apache to support PHP in the Apache main configuration file httpd.conf Include custom profile in

In Apache’s main configuration file / conf/ http.conf Add at the bottom Include “D:workspace_phpapache-php.conf” The file path can be any In D: workspace_ Create under PHP file apache- php.conf file Its specific content is [html] view plain copy PHP-Module setup LoadFile “D:/xampp/php/php5ts.dll” LoadModule php5_module “D:/xampp/php/php5apache2_2.dll” <FilesMatch “.php$”> SetHandler application/x-httpd-php </FilesMatch> <FilesMatch “.phps$”> SetHandler application/x-httpd-php-source </FilesMatch> […]