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

  1. Right-click in the blog folder and open Git bash.

  2. Enter hexo new "Blog-Title" to create a new Markdown file. The name within the double quotes is the article’s title.

  3. 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.

  4. 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.

    Note:
    Pay attention to the space after the colons.

    • After the --- divider line, you can start writing your blog post following Markdown syntax rules.
  5. Save your changes after writing.

Generate New Webpage and Deploy

  1. Open Git bash.
  2. Use the command hexo clean to clear the webpage cache.
  3. Use the command hexo g to generate new webpage files.
  4. (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 familiar ctrl c but ctrl ins. Using ctrl c to copy the preview URL will terminate the local server process, causing the preview to stop working.

  5. 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.