Choosing a theme

Make a subdirectory called themes and change directory to it and clone the theme you have chosen there:

git clone https://github.com/zyro/hyde-x

Once this theme repo got cloned into my project I then removed its .git directory by changing directory into the themes root folder and removing it:

cd themes/hyde-x
rm -fr .git

Configuring your project and theme

In the root of your project there is a file called config.toml that you need to update to configure your site. You can look at my configuration to get an idea of the things you can set. For your theme specific settings of course look at the github repo for your theme’s readme for detailsi (e.g. for my chosen theme: hyde-x documentation).

Content Types, Archetypes and Front Matter

I have decided to have two content types:

post for my blog posts

page for my sites static pages (like my about me page).

When creating any kind of content using Hugo you must provide some meta data about it. This meta data is known as front matter.

You can get Hugo to automatically create the above front matter for you for each content type. These are called archetypes. If you look at the archetypes subdirectory of my project there are two archetypes default.md and page.md. Any content created that is of type page will have the contents of page.md added to its header. Any other content type will have the content of default.md added to its header.

So this will be added to the top of every content of type page that I add. Of course I will have to edit this template for each content with that contents specific meta data.

The main difference between my two different content types is that the page.md content type has menu = "main" this tells hugo that this content is not a blog post and it should be added to the left column of my website below my name as a link.

Creating Content

To create content, from the project root you call:

hugo new <content type>/<name of new content md file>

So to create this page I did:

hugo new post/migrating-from-pelican-to-hugo.md

So to migrate my blog posts from pelican to hugo I used to above command to create a post with same file name as I had in pelican, copy and pasted the contents of each file from my pelican project to my hugo project. Note that of course I did not copy the front matter of my pelican posts across. Instead I updated the hugo front matter with the same meta data as I had in pelican manually. I repeated this process for my pages too.

Permalinks

My permalinks structure for my old pelican based blog was:

/blog/<slug>

meaning to access my a post it would have URL like:

http://www.softinio.com/blog/<slug>

In hugo I have changed this to:

/post/<slug>

meaning to access my a post it would have URL like:

http://www.softinio.com/post/<slug>

I could have kept it the same so that the URL to my existing content moving from Pelican to Hugo would not change, but I prefered to move forward with it this way. This is a personal choice of course.

If you have a look at my config.toml file you will see under the permalinks section how I have defined my permalinks.

Moving my domains DNS management to Amazon AWS Route 53

I followed the steps in this Amazon document to move my domain’s DNS management.

Creating a User on Amazon AWS to use for deployment

We need to create a user on Amazon AWS to use for deployments to the S3 bucket we created. To do this log into your Amazon AWS console and select Identity & Access Management, then select Users and then select Create New Users.

Give the new user a name and make note of the access keys for this user that gets generated for you.

You will need to create a policy and attach to this user. Here is a sample policy you can use: