HEXO Deployment
The blog has been successfully set up, and the next step is to use Hexo with Markdown to write blog posts.
Writing Process with Hexo
The blogging process is much simpler compared to the setup. It involves just a few steps:
- Create a new blog post file
- Generate a new webpage
- Deploy to Github Page
Create a New Blog Post File
Right-click in the blog folder and open Git bash.
Enter
hexo new "Blog-Title"
to create a new Markdown file. The name within the double quotes is the article’s title.Navigate to the
blog/source/_posts
folder. You’ll see the newly created file,Blog-Title.md
, with an.md
extension, indicating a Markdown file.Double-click to open it with your installed Markdown editor for editing.
- The file will have default content (using this blog as an example):
1
2
3
4
5---
title: HEXO&Markdown
date: 2019-04-04 10:50:41
tags: [Hexo, Markdown]
---- The
title
represents the blog title. - The
date
is the creation time of the blog, which doesn’t need to be changed. - The
tags
represent the blog’s tags.
- The
Note:
Pay attention to the space after the colons.- After the
---
divider line, you can start writing your blog post following Markdown syntax rules.
- The file will have default content (using this blog as an example):
Save your changes after writing.
Generate New Webpage and Deploy
- Open Git bash.
- Use the command
hexo clean
to clear the webpage cache. - Use the command
hexo g
to generate new webpage files. - (Optional) Use the command
hexo s
to generate a local server and preview the webpage by visiting the provided URL.Note:
The copy command in Git bash is not the familiarctrl c
butctrl ins
. Usingctrl c
to copy the preview URL will terminate the local server process, causing the preview to stop working. - Use the command
hexo d
to deploy the webpage to Github Page.
The above is the complete process. Each time you update your blog, you’ll need to repeat the steps mentioned above.
To simplify, you can merge commands and directly use hexo cl
and hexo g -d
to update.