Getting started with the Hugo static site generator

This blog is being powered by a static content generator called Hugo and hosted on GitHub Pages. Getting Hugo up and running was relatively easy. Download the relevant version and installation was just copying it to a folder.

Once installed, create a new site:

hugo new site mySite

In the site folder edit the config.toml file to change the baseUrl, the language and the title.

Use git to clone a theme from the available themes to a folder under the themes folder in your site.

A page can be added by typing:

hugo new post/somepost.md

and then editing the file generated under the content/post folder. You might want to remove the “draft” line".

To test the site, run:

hugo server -t thethemename

where the thethemename is the name of the theme folder and then go to the url given in the console output.

To build the static content:

hugo -t thethemename --destination=/somefolder

where somefolder is the name of the folder to build the content to.

This can then be pushed to GitHub.

Side note: You might also want to “git config core.safecrlf false” on the github folder to remove some CRLF warnings when pushing on Windows.

Links

Hugo

Available themes

Related Posts

How I learnt to pick ideas that win

I come up with lots of ideas for potential applications, businesses, stories and random other things.


Read More

Questions to ask yourself before you buy

Sometimes it is very easy to buy things just for the sake of it. We get that rush when either we bring the item home or it is delivered. It is easy to form an addiction to that feeling.


Read More

Why? Not no

One of my favourite podcasts is Hanselminutes by Scott Hanselman. I have been listening to it probably longer than any other podcast. He recently interviewed Roberta Arcoverde from Stack Overflow. She talked about how the architecture of the Stack Overflow site is very different from most other large sites in that it is a self hosted monolithic application.


Read More