Create a Blog Part 1: Simple

Previously I was using WordPress to host my practically abandoned blog. As I rarely updated my blog I wanted to redesign my blog and use a framework that made creating content as simple as possible, and publishing fast.

I decided to use Hugo as my blog’s framework. I chose Hugo for a few reasons. 1. Markdown for content creation 2. Website is entirely static, not backend database needed 3. The Hugo documentation was super simple and easy to read, compared to a couple other static frameworks I looked at

Installing Hugo and creating a website couldn’t be easier, I just followed the Quick Start documentation.

I use macOS and already have brew installed, therefore all I had to run was

brew install hugo

To create the website, it is as simple as running the ‘new site’ command.

hugo new site myblog

Then change directory.

cd myblog

I plan to add the site to git source control.

git init

The next step is to decide on a theme. I wanted a minimalist theme and decided to use Minimo.

git submodule add https://github.com/MunifTanjim/minimo themes/minimo

Copy the example config.toml file for minimo and replace your config.toml.

cp themes/minimo/exampleSite/config.toml config.toml

To create a blog post use the ‘new’ command.

hugo new posts/firstpost.md

Open up the firstpost Markdown file in your favourite text or Markdown editor and add content to you post.

You will notice by default your new post will specify “draft: true”. These posts are hidden when viewing your website unless you serve your website with drafts on.

Serve up your blog locally, specify -D, to view your site with drafts on.

hugo server -D

Open the local URL specified in the console in your favourite browser.

Play around with changing the configuration specified in the config.toml file that was copied earlier. As you save this file, you will see the website update to reflect the changes.

I don’t think creating a blog website could get much simpler. So far I’m really impressed with Hugo.

In my next post I’ll show you how you can host your website for free.

comments powered by Disqus