Mind is Software

Ying’s thoughts about software and business

Use Hugo and Netlify

This article describe the steps to create a new blog site from scratch and deploy it to Netlify. The process is pretty easy and pleasant.

1 Initial Setup

First, create a github repository and clone to local computer.

Second, in a temporary folder, use hugo new site start to create an initial site, then move all files/folders in start/ to the local cloned repository.

Third, in local repository folder, clone the bootstrap4 blog theme to themes/bootstrap4-blog, delete the .git/ folder and .gitignore file.

Fourth, edit site config as suggested by the theme document.

Then, create a netlify.toml file with the following settings:

[context.production.environment]
  HUGO_VERSION = "0.35"

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

2 Setup Netlify

Finally, create a netlify account and connect to the Github repoistory.

Then customize domain name and add CNANE to map custom domain to netlify domain name.


Share