Go to the correct folder
1 | cd hexo |
For example, as for macos operating system, I store all the hexo post information in the folder called hexo, so cd into that folder. When you enter the correct folder, the path name will show on the left side of the terminal. Here, it will display hexo
.
Create new blogs
Enter the following bash command
1 | hexo new "the name of the new blog" |
Find and edit the new blog
After that, open the /username/root folder name/source/_posts
. More concretely, my absolute path is /Users/zxy/hexo/source/_posts
. You will find a new markdown file named in the name of the new blog.md
Then, open this file in vscode, you can use various extension in vscode to help you to start writing your blog!
Generate website and preview
Enter the following in root dictionary to generate static website.
1 | hexo g |
Enter the following to preview preview your blog locally.
1 | hexo s |
Push to github
Enter the following to upload it to github. Finally ,you can see the new content in your github.io website.
1 | hexo d |
Reference
Contents refer to
https://sunhwee.com/posts/6e8839eb.html#toc-heading-14