Create a blog by Hexo.

This article is made for self using in the future. Since I am an amatur and just want to own a personal blog.
All the actions in this article have been tried by me and are necessary and effective.
Thanks to the authors of the videos and articles cited in this article. All I did based on Hexo was from their sharings, especially Codesheep and 程序员茶社.

1. A holistic view of Hexo blog

Hexo itself made a very good introduction, and following with detail operations to guide the installation and using Hexo. Besides, the videos mentioned above and the article helped to install and initiate Hexo hand by hand.
In a word, Hexo is based on Node.js and git.

1). Download and install Git

2). Apply a Github account and using Git to generate and SSH keys to deploy works to Github.

3). Download and install Node.js by following the default instrcutions.

4). Download the Visual Studio Code in Microsoft store or the official website.

2. Installation of Node.js and Git

1). Install Node.js

Node.js

You can find a lot of the very good instructions online to show you how to install Node.js, but all of them have the same characteristic which is asking you to follow the default instruction from Node.js
For the operation commands and troubleshooting guide of Node.js, see the related information on the official website

2). Install Git

"Git install"

The best way to install Git is always following the offical guide, it is easier when some good soul listed the detailed operations for reference.

To Git, the problem for rookies isn’t how to install it, but how to sign up for an account on Github, and global the accout with the SSH keys for the connection with Github.
Then the following codes are necessary after login the github account.

'github'

1
2
3
4
5
$ git init
$ git config --global user.name "user name"
$ git config --global user.email "example@email.com"
$ git config -l
$ ssh-keygen-t rsa -C "example@email.com"

Following the instructions by RUNOOB.COM to paste the SSH keys in “id_rsa.pub“ in Github “SSH and GPG KEYS” page. (It is easier to find files with Everything)

"id_rsa.pub"

3. Install Hexo and Initation

Now, it’s time to use CMD command or GIT to create a Hexo blog by following the listed commands:
1). Install Hexo

1
$ npm install -g hexo-cli

2). Update the Hexo to the newest version

1
$ npm update hexo -g

Then there will be a folder named “Blog“, in it will be the listed folders:
snap blog

4. Hexo operation commands

Only a few commands will be used usually:

1
2
3
4
5
$ hexo clean
$ hexo g
$ hexo s
$ hexo d
$ hexo new <title>

The explanation for different letters are:

1
2
3
4
5
{
g: generate;
s: server
d: deploy
}

5. Hexo themes download and use

1). Search the fancy theme on Hexo official website.
2). Login the github.com to find the repository and download with GIT by the following code.

1
$ git clone https://github.com/litten/hexo-theme-yilia.git themes/yilia

"yilia"

3). Open the _config.yml by VS code and change the theme to yilia, like below:

1
theme: yilia

4). In the deploy item of _config.yml still under blog folder, make some changes as follows:

1
2
3
4
deploy:
type: git
repo: https://github.com/example/example.github.io.git
branch: master

6. Visual Studio Code

1). Find the training video from Bilibili by 想变强的语汐.
2). Find the training video from Bilibili by 偶尔有点小迷糊

Author

Leo

Posted on

2022-02-04

Updated on

2022-02-05

Licensed under

You need to set install_url to use ShareThis. Please set it in _config.yml.
You forgot to set the business or currency_code for Paypal. Please set it in _config.yml.

Comments

You forgot to set the shortname for Disqus. Please set it in _config.yml.
You need to set client_id and slot_id to show this AD unit. Please set it in _config.yml.