Switching From Hexo to Hugo

My first hugo blog post.

Crazy time trying to figure out differences sections, types and layouts.

Finally the dust settles, with a few compromises.

TODOs

And the move is officially done!

Learnings

Categorization:

Categorization of posts in happen through two concepts:

  1. Sections:
    The 1st level folder under which a post is created in the folder “content” is the section of that post.
    • Type = Section by default. The type can overridden through Front Matter. Sections can’t be overridden.
  2. Taxonomies:
    Taxonomies are user defined groupings of content. Taxonomies have to be defined in the config file except for tags and categories which exist by default.

Section Structure:

There are ways to disconnect the folder structure from the URL structure in Hugo. Per post this can be accomplished through front matter named url and on a website level the following config achieves the same:

1
2
[permalinks]
post = "/:year/:month/:title/"

However fatigue prevailed and I decided to go for a structure where there is balance between the number of brain cycles that get extinguished trying to decide where every new post needs to placed and the logical structure of posts on the website. This middle ground was the decision to use only the year in the URL.

This allows one to achieve the minimum level of segregation required at the filesystem layer, prevents the URL from looking really bad and also informs the user if the post being read is too old (going for month in this case is an overkill). This also allows for zero manipulation of the path to url conversion.

Creating new posts:

See archetypes.

Command:

1
hugo new <content-section>/<file-name.md>

Eg: `hugo new post/2017/switching-from-hexo-to-hugo.md`