1. Prepare the environment

Software required:

Node. Js - > v12.18.3

NPM - > 6.14.6

Git - > 2.16.2 windows1

Copy the code

2. InstallHexo

First create a directory on your disk, such as C:/Blog, open a command-line tool, and type

C:                      Go to drive C

cd Blog                 Enter the Blog folder

npm install -g hexo-cli # The process of installing hexo is extremely long, so I suggest having a cup of coffee if you haven't modified the NPM mirror source

Copy the code

Assuming nothing goes wrong, no errors, no warnings, congratulations, you’re in Hexo.

In 3.GithubcreatePages

There are two ways to create Pages: you can create Pages belonging to the “repository” or you can create Pages belonging to the “account”, the latter is created here (account belonging), because it is nice. The main differences between the two are:

  1. The final access path for warehouse ownership is:{username}/{repo}
  2. The final access path of the account is as follows:{username}.github.io

During the creation process, you need to set the warehouse name to your account name in order to implement the second option above.

4. Create a local blog and preview it locally

Go back to the command line at Step 2 and type:

hexo init blog     Initialize the blog repository

hexo new HelloHexo # Create your first post

Copy the code

You can then go to the hellohexo. md file in the C: Blog source _post directory, find a MarkDown editor that you can use to edit the file.

After the modification is complete, go back to the command line interface and run the following command:

Hexo Clean # (Optional) Clean the cache for later regenerating Hexo C

Hexo generate # Generate related pages, also hexo G

Hexo Server # launches local preview, or hexo S

Copy the code

Then you can see your blog preview in http:\\ \localhost:4000. If it is successful, congratulations and you can have another cup of coffee 😝.