The preparatory work
-
node
-
NPM (after installing Node). If NPM is slow to download, you can install CNPM
-
Node installs the hexo-cli module: NPM install -g hexo-cli
Start building (Windows platform)
-
Create a new folder to put our blog in
-
Open CMD in this folder and type the relevant commands
-
Hexo init: Initializes the creation of the blog
-
Hexo S: Open the blog (default address: http://localhost:4000)
-
Hexo n ‘XXXX’ : Create a new blog post
-
You can then write the relevant content in this MD file
-
Hexo g: Generate the file
-
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
-
Create a repository on GitHub (note that the repository must be named in a format of: username.github.
-
Hexo-deployer-git: NPM install -g hexo-deployer-git: NPM install -g hexo-deployer-git
-
Edit the _config.yml file
The repo is the GitHub repository’s SSH address (which reduces unnecessary errors compared to HTTPS addresses). -
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
-
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
-
Go to GitHub repository: Git clone the repository address to themes/ XXX (folder with the name of the theme).
-
At this point you can see the clone theme file under the themes folder
-
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 -
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!!!!!!