The preparatory work

  1. node

  2. NPM (after installing Node). If NPM is slow to download, you can install CNPM

  3. Node installs the hexo-cli module: NPM install -g hexo-cli

Start building (Windows platform)

  1. Create a new folder to put our blog in

  2. Open CMD in this folder and type the relevant commands

  3. Hexo init: Initializes the creation of the blog

  4. Hexo S: Open the blog (default address: http://localhost:4000)

  5. Hexo n ‘XXXX’ : Create a new blog post

  6. You can then write the relevant content in this MD file

  7. Hexo g: Generate the file

  8. Hexo clean: Clear the cache (preferably every time)

Associate your blog with GitHub (push it to GitHub)

The advantage of this is that you do not need to rent a cloud server to mount, do not need to apply for a domain name, very friendly to the student party

  1. Create a repository on GitHub (note that the repository must be named in a format of: username.github.

  2. Hexo-deployer-git: NPM install -g hexo-deployer-git: NPM install -g hexo-deployer-git

  3. Edit the _config.yml file



    The repo is the GitHub repository’s SSH address (which reduces unnecessary errors compared to HTTPS addresses).

  4. Then you can push your blog to the GitHub repository: hexo d (first input will prompt you for your GitHub email, password, username, etc.)

    At this point, you can see the pushed blog file in the GitHub repository

  5. At this time you can enter the name of the warehouse just named in the browser, you can access to their own blog

Change the theme of your blog

Hexo theme

  1. Go to GitHub repository: Git clone the repository address to themes/ XXX (folder with the name of the theme).

  2. At this point you can see the clone theme file under the themes folder

  3. Then edit the _config.yml file

    The theme section just sets the folder name for the theme



    I’m going to re-hexo g, hexo d, hexo clean

  4. Blog may not be so fast to show changes, you can refresh a few more sites

The image cannot be displayed

Refer to website: https://www.jianshu.com/p/ea78bdd0551f/

At the end

In general, when you modify some of your files and then push them to the GitHub remote library in sequence, the commands are :(mostly) hexo g, hexo d, hexo clean

Finally, welcome to visit my personal blog, which is updated from time to time!! (https://taptaq.github.io/) hope to useful, thank you!!!!!!