Hugo - Why Use?

Using Hugo to Manage Your Website

Jonathan Homer

4 minute read

When you develop web applications for a living it can be tempting to write your website for your company from scratch. However whilst you may be an expert at writing great web applications, it is a different skill writing a web site. Especially to get to a level that it looks good, rather than functional which is the aim of applications. Perhaps this is not so bad if you are a website developer, but I have noticed that whilst I can write web applications that are easy to use and look greate. Writing a web page for your company is a specific seperate skill.

So perhaps you may have a decision, our website is not good, we need to fix it. Perhaps you think you can build a simple CMS site so that you can update it easy. But you know it takes time to write a decent CMS system. So perhaps you think, I will find a pre-built CMS engine to build it that way.

However all of this takes time. Time to learn a new system. It also then requires hosting with a backend database so that has got to be arranged. Then it requires maintenance and so on and updating. All this for a company that should be writing web applications that provide income!

So what we want is a simple way of building and maintaining a website that looks good. Quick to add decent contact, without requiring expertise in a web language. Not that you don’t have the expertise, but time poor.

So what is the alternative?

You can use a Static Web Site Generator! This generates a website from simple text files, and builds a web site with all the bits and bobs required to give a professional result.

There are a number of different Static Website Engines. As you likely have worked out from the title. I have chosen Hugo!

I am sure each Static Website Engine will have their followers and reasons why. However in this case Hugo will do most of what you want. The worse decision you can make is not to make one. Hugo seems fast, well supported and quick. So remember we want to save time, so decide Hugo. ;-)

Choose a theme

Google “Hugo Themes”. Find one you like. For my website I have used this one

https://github.com/jpescador/hugo-future-imperfect   

Configuration

The next stage is to edit the config.toml file. This sets things like the titles. What features are required and so on. Each theme is slightly different. However it shouldn’t take too long to configure a reasonable set up. The best theme’s have good instructions to add and change the design. Don’t be afraid to change themes. It is is easy to change the one that you have.

Perhaps you can’t find a theme that is just right. This is where you can alter the themes. With a little bit of work it doesn’t take much work to add minor changes. Remember though. The mission is to write a simple company website. Don’t get too tied down in writing the prefect website. Especially if your income stream doesn’t come from the web site.

Now Important Bit

Once you have your basic design and perhaps fiddled with the theme slightly you can start the actual mission of writing pages.

You write the pages in Markdown. This is fast. There are many tutorials on how this is done. So for example a heading is done simply by this:

# Heading

Some Text

## Sub Heading

More Text

Search for Markdown and you should find many excellent tutorials. If you are a programmer you may have already used it with GitHub and GitLab both support Markdown.

You can also add hints to the theme of where you want the document. Again see the theme as each are slightly different. However you can see the markdown for this actual entry below. It doesn’t take long to work out what it does.

+++
author = "Jonathan Homer"
categories = ["Website","Hugo"]
date = "2020-06-11"
description = "Using Hugo to Manage Your Website"
featured = "pic02.jpg"
featuredalt = "Pic 2"
featuredpath = "date"
linktitle = ""
title = "Hugo - Why Use?"
type = "post"
+++

All of this gives the most important advantage, speed. Remember in the end Google Search engines are looking for valuable content. So being simple to write, concentrating less on how beautiful it looks. Means you can write more content. Writing a few pages a week suddenly becomes feasable.

Deploying

Run hugo serve to see what it looks like. To build the site you normally just run hugo . It writes out the site in a folder named public. So you can see With a little work from your CI you can the write an automated process. So the content writers just create Markdown files in a directory. A few minutes later the CI process can actually be made to deploy this.

I will be posting more on how this is done.

comments powered by Disqus