23 Aug 2016, 22:43

Migrate Octopress to Hugo


My blog was based on Octopress blogging system, based on jekyll, but I was never a ruby person, it also seems like Octopress is not so active lately,

In the other hand, Hugo feels super slim and simple, thanks to Go and Hugo, it takes only few lines to start a blog,

You can download a binary package of Hugo, but I have Go installed so it’s simply 1 command:

go get -u -v github.com/spf13/hugo

Creating a new blog is simply one command:

hugo new site myblog

This command creates the myblog folder with some initial data that serves as a baseline for our blog.

Adding a new post is simple as:

hugo new post/welcome.md

This generates the content/post/welcome.md file, a post is just a simple file, no magic!

A theme defines how the blog look like visually, there are many themes, choose the one you like, in this post, I use the purehugo theme because it’s clean and simple.

cd themes
git clone https://github.com/dplesca/purehugo.git

Lets star a local server to see our shining new blog:

hugo server --theme=hugo_theme_robust --buildDrafts

Hit in browser: http://localhost:1313

You should see the welcome blog entry we just added.

Migrate from Octopress

Hugo has a built in support to migrate from jekyll

cd my_octopress_blog
config.yaml ... source/ ...
hugo import jekyll source/ hugo-import/
Congratulations! 26 post(s) imported!

Make sure to have config.yaml and the source folder in current directory, running the import command should import all files

Simply move the posts folder into your new blog content folder by:

mv hugo-import/content/post/* <location_of_new_hugo_blog>/content/post`

Happy blogging!

comments powered by Disqus