hugo
Create a New Hugo Site Project
Hugo is a framework for creating static websites, an SSG, Static Site Generator. It is written in the Go programming language.
Hugo has a very simple structure.
There is a content layer where you write the individual
content of your pages. The content is mainly written in the
markdown markup language.
The content is wrapped in a theme layer taking care of
the resulting HTML, and the layout of the pages. In that
layer there are rich facilities for the DRY pattern in
your development effort.
At any point during the process, you may build and test
your site. The result of the build process is contained
in a public
directory. This directory contains all
that will eventually be deployed for publication.
The Infrastructure of your Site
From the command line first do:
|
|
if you see no errors do
|
|
hereby you make hugoone the working directory, and you
create your project repo in that directory.
In addition you create a hugo appropriate .gitignore
for your project.
To get a bearing of the consequences of these initial steps, take a look at the initial file and directory content of your site:
|
|
You may now test start serving the site
|
|
Go to your browser and navigate to: http://localhost:1313
.
You should expect something like:
This is not an error, but just a result of not yet having written any content for the project.
Add a Theme
You must add a theme to your project. The presentation and the skeleton layout of your site comes from the theme.
|
|
This theme is minimal. Eventually you will want to create your
own theme(s), but until then this will be useful.
Please read it’s author’s
remarks in the
README
of their repo.
Add a Content Page
There are several ways of doing this, but canonically we would do:
|
|
where the first three words says that we, in hugo
, creates new
,
content
,
and the last bit designates the content file.
The path is an important structuring element.
The section program
will be given a subsection
cloud
in which we place the content file cloud0.md
which we subsequently edit to supply the actual content.
The created content markdown file will look as follows:
|
|
When the content renders, it’s outline will have the title
as its H1
header.