Posts List
  1. Introduction
  2. Workflow
    1. Creating a Draft
    2. Compose with Sublimetext and Markdown
    3. Adding Pictures through Asset
    4. Publish, Preview and Deployment
  3. Here it is

My Hexo Work Flow

Introduction

This is the second one in the series of “Using Hexo & Github to Create Your Own Blog”. In the first one, we’ve covered how you can set up a basic functional blog using hexo and github and things like how to create a new post or how to deploy your content. In this article, I would share the workflow that I use when I am composing for my blog.

Workflow

A good Workflow, basically, allows you to begin your work and proceed to the next step seeminglessly.

My typical day to begin writting for my blog is by opening the command line in the windows and find the directory of my blog.

Creating a Draft

To begin writting a new article, you would not want to start a new post right away, as you won’t necessarily finish the writing.

So instead of using the command that is used to create a new post:

1
hexo new "title"

Instead, you should use:

1
hexo new draft "title"

The command would create a folder called “_draft” in your own source directory, and you would find your draft there.

Compose with Sublimetext and Markdown

Then, open your sublime text and start using markdown to compose. You can find the markdown tutorial here and articles related to sublime text here.

Adding Pictures through Asset

Adding pictures sometimes can be tricky in Hexo.
The conventional way of adding pictures for markdown is by using an external iamge link like this:

1
![your alteration text for images](the link of the image.png "Title")

However, hexo provide a much easier way to add images to your posts. It is called the Asset Folder.
Open the config.yml in your root folder of hexo, and turn the “post_asset_folder” to ture.

1
post_asset_folder: true

Each time as you create a new post, hexo would create an asset folder that has the same name as your post. You can put the images in your asset folder and simply link to the image by using the following syntax.

1
{% asset_img example.jpg This is an example image %}

Publish, Preview and Deployment

After you finish your writing. You need to publish your draft and turn it into a post. Open your cmd and use “hexo publish”:

1
hexo publish "the title"

After you publish your draft, preview your blog on the local server before deployment.

1
hexo s

And then deploy:

1
hexo g -d

Here it is

Now, you should have the basic idea of how to do with your blog. You can also find tutorials on choosing themes for your blog and adding mathjax to support the display of Latex here.

Best Wishes.