I had used GatsbyJS for two years, for now, I decided to change it. The main reason is, gatsbyjs upgrades from v3 to v4, and also take me having several breaking changes, I almost get errors when I upgrade it, it’s time to focus on my aim: blogging, so I choose Hugo to be my blogging platform, here is my notes when I built it. I read the official documentation, it’s really friendly and easy to read.

Next, follow the documentation and step by step to build.

Installation

$ brew install hugo
$ hugo new site yish.dev

That’s it, pretty simple.

Theme

I chose PaperMod to the first, fast and simple. And you can refer example site.

Netlify

hosting-on-netlify

  1. On your project directory, create a netlify.toml and paste it
[build]
publish = "public"
command = "hugo --gc --minify"

[context.production.environment]
HUGO_VERSION = "0.89.4"
HUGO_ENV = "production"
HUGO_ENABLEGITINFO = "true"

[context.split1]
command = "hugo --gc --minify --enableGitInfo"

[context.split1.environment]
HUGO_VERSION = "0.89.4"
HUGO_ENV = "production"

[context.deploy-preview]
command = "hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL"

[context.deploy-preview.environment]
HUGO_VERSION = "0.89.4"

[context.branch-deploy]
command = "hugo --gc --minify -b $DEPLOY_PRIME_URL"

[context.branch-deploy.environment]
HUGO_VERSION = "0.89.4"

[context.next.environment]
HUGO_ENABLEGITINFO = "true"

[[redirects]]
from = "/npmjs/*"
to = "/npmjs/"
status = 200
  1. link your repository.

That’s it, but I still configure :)