Posted onEdited onInhexo Symbols count in article: 484Reading time ≈2 mins.
Hexo Usage
How to Write a new post
Generate new post in your terminal: hexo new "Your post name"
Open your project by vscode, then open file: source\_post\Your post name.md
Edit your post with vscode, hexo support markdown and ejs files
Clean cache
After finish editing, you can type hexo clean in your terminal to clean the cache, clean is short for clean here.
1
hexo clean
Generate static files
After finish editing, you can type hexo g in your terminal to generate static files, g is short for generate here.
1
hexo g
Publish your post
Type hexo d to deploy your post to github.io, d is short for deploy here.
1
hexo d
View your post
open zdd.github.io to see your post, good job!
you can use npm run deploy to combine generate and deploy in a single command.
View post locally
Run hexo s in terminal, then open localhost:4000 to see your post, this is very convenient to check your post before publish.
1
hexo s
404 File not found
When you encounter the 404 error, make sure to do the following
Check your source\_post\Your post name.md file name, make sure it is the same as the title in the file.
run hexo clean to clean the cache
run hexo g to generate static files
run hexo d to deploy your post to github.io
Tags not working
Make sure you have a tags folder under source folder
Install easy tag plugin by npm install hexo-easy-tags-plugin --save
Delete .deploy_git folder
Run hexo clean to clean the cache
Run hexo g to generate static files
Run hexo d to deploy your post to github.io
Force refresh your browser by Ctrl + F5
Make sure tags config in themes\next\_config.yml is correct, remember to set amount to a large number
1 2 3 4 5 6 7
tagcloud: # All values below are same as default, change them by yourself. min:12# Minimun font size in px max:30# Maxium font size in px start:"#ccc"# Start color (hex, rgba, hsla or color keywords) end:"#111"# End color (hex, rgba, hsla or color keywords) amount:2000# <--------------- Set this to a large number