Migration from Hexo to Hugo
How this blog was created
In 2015, I built this blog with Hexo and Theme Octo.
Why I migrate to Hugo
Hugo is written in Golang and it’s much faster.
How to migrate
Installations
Install Git and Go
Install Hugo
|
|
Create a site
|
|
Pick a theme
There are a bunch of Hugo Themes for you to pick. I picked the DoIt theme.
Why I chose DoIt
There are so many exciting features, like mobile-friendly, search, i18n, emoji. The full feature list is here
Use the theme
There are two ways to use the theme you chose above.
|
|
or
|
|
Create a blog post
|
|
Migrate Hexo posts
Copy the posts
Execute the following commands in the root directory, which is blog here.
|
|
Then copy all your Hexo posts to the folder posts
NB
After the site was created, there would be a template for new post like below in the file $site$/archetypes/default.md
|
|
You should assign false to the draft item to publish your blog.
Preview the blog
Just run the command below to preview your site at http://localhost:1313/
|
|
Publish the blog
Create a Github repostory
Before publishing, you have to create a repo on Github like this
|
|
Publish with commands
Commands for publishing your blog posts.
|
|
Build a shell script to publish
To do the deployment easier, you can build a shell script named deploy.sh in the root directory of you site with the content below.
|
|
And assign execution permission to deploy.sh
|
|
Next time when you need to publish, you just run
|
|
Other issues
TO BE UPDATED.