Notes on Everything
Jotting down anything useful since I'm a forgetful person...
Part 1 is here.
First we need to prepare configuration file for netlify in hugo.
1 touch netlify.toml Paste the following into the netlify.toml file. Change the HUGO_VERSION to accordingly.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 [build] publish = "public" command = "hugo --gc --minify -b $URL" [context.
In the previous article, we have finished setting up Hugo and configuring the Visual Studio Code as the text editor with WSL & terminal built in.
Now, let’s assume you have successfully created your first website locally and ready to show it to the world wide web. Since Hugo is a static site generator, you can virtually hosted the static website anywhere once you have built your hugo project.
In this article, I have opt to automate the process of publishing the website using Github to host the website code repository and Netlify as the hosting provider.
Prerequisite Before we are able to install and develop out website with Hugo, below are what I assume we have already set up & running:
You have a Windows 10 computer with WSL running. In my case I am using Ubuntu from Windows Store. You are familiar with Visual Studio Code (VSCode). Installing Hugo Open a Ubuntu terminal and run this command:
1 sudo yum install hugo This will install hugo and a bunch other required dependencies depending on your systems Once Hugo has been installed, you are now be able to verify by typing hugo version from the terminal.
Hugo uses the excellent go html/template library for its template engine. It is an extremely lightweight engine that provides a very small amount of logic. In our experience that it is just the right amount of logic to be able to create a good static website. If you have used other template systems from different languages or frameworks you will find a lot of similarities in go templates.
This document is a brief primer on using go templates.