Hugo - Static Site Generation guide
Quick Guide
I use Hugo to build this blog site. It is lightweight, simple to pickup and thematically leans into the Linux way of building. Hugo creates static sites and is designed for performance. It has a strong templating support and allows for re-use and fast implementation. Hugo runs in terminal and has all functionality (and is actually practical) from CLI, very unusual for [current year].
Let’s run through some important hugo commands:
hugoThis builds the project within the /Public directory. You do not want to publish this folder, so add it to your .gitignore file.
What is interesting about hugo is it is build in a development folder structure first. There is a central config file that acts as a build sheet and references variables or Parameters. The build instructions have a backend workflow that is not needed to understand to start building - a great benefit to actually adopt and start creating!
hugo server -D
hugo server —buildDraft
hugo serve To view the rendered site, run this command from a local terminal tab and browse to your local host webpage. The -D and —buildDraft flags both activate any draft posts as by default, drafts are not published, allowing for a convenient way to preview upcoming articles.
hugo new /posts/article.md
hugo new page.md
hugo new /posts/article.md --kind differentTemplateBuilds a new content file and pulls in either the standard template or an alternate one if specified.
hugo.tomlLastly it is worth mentioning this configuration file, it is not a command but is the central location to define the parameters used for the site. Both standard Hugo configuration and theme dependant parameters are defined here, and themes will have their own naming convention so it is important to reference their respective documentation.