Estimated reading time: 2 minutes
Installing on a mac could not be easier with brew. If you do not have brew installed you can follow the instructions at https://brew.sh/
Step 1 install hugo via brew:
brew install hugo
and abracadabra thats it!
To install hugo using windows or linux head to https://gohugo.io/getting-started/installing/ to see the detailed instrauctions.
This file is essential to getting your hugo site set up correctly. There are so many possible variables to use it is impossible to include them in one tutorial. the ones I use are:
contentDir = "content" layoutDir = "layouts" publishDir = "public" buildDrafts = false canonifyURLs = true baseURL = "/" languageCode = "en" title = "Learn HUGO" [taxonomies] category = "categories" tag = "tags" [params] subtitle = "For me to learn HUGO!" author = "DAVE WALSH"
contentDir variable explicitly tells hugo what folder i want content to be held in. this is actually automatically done buy hugo and the variable is not needed but it is good to be explicit, just incase you wish to change this in future.
layoutDir variable defines the place of the templates. Again it is not needed to set this.
publishDir variable sets the folder for where the rendered site is published to.
buildDrafts variable is a switch to allow hugo to build pages in draft mode which you control with a varaible in each pages front matter.
baseUrl is a required variable. For local builds I use “/” but then change to the full uri of the website once placed live.
languageCode sets the language encoding that is used on the meta of each page.
title is the last of the required variables and is the title of your site.
Part 3 of 15 in the hugo zero to hero series.