Macklus.Net

Macklus.Net


For fun and profit

Discovering Hugo, the static CMS

macklusmacklus

También puedes leer este apunte en castellano pulsando aquí.

Since a while ago I started moving all the services that I currently have towards serverless systems, I also started looking for a CMS that will allow me to completely remove WordPress, which is the CMS that I currently use.

If I evaluate the use I make of this CMS, the truth is that I do not need almost any of the options it has (let’s not talk about the thousands of plugins) and that if I currently continue to use it, it is because I like the theme I use , which requires WordPress.

Hugo, generating static sites

Hugo is, according to its creators, “one of the most popular open source static site generators” . Its main advantage is that it creates static HTML files that do not require any server language to function, so we can serve them from Amazón S3, which will only charge us for use, and forget about having a VPS running all day.

In addition, serving static content that does not have to be generated will always offer us a much higher performance than any web with server processing. As an example, the result of running Lighthouse on a site created with Hugo and without any SEO or performance improvement:

Working with Hugo

Working with Hugo is really simple, since it is programmed in Go , so all you have to do is download the corresponding binary, available for any platform .

In addition, the contents that we create will be created as text files in YAML format, so we don’t need any special editor, and Hugo will be in charge of generating the final content in HTML, AMP or the corresponding format, while we can focus on the content, which is the most important thing.

For the design of our site, Hugo has more than 600 themes of different themes available totally freely, with totally professional styles.

If we want to have a more dynamic option (such as forms or comments), from Hugo’s own site we will see the different options available, which are many.

Publishing a website with Hugo

Since we already have our website created with Hugo, when publishing it we can use multiple options.

In my case, I have chosen to publish in S3 from Amazon , using CloudFront as cache. With this configuration I ensure that my content is always available with a very powerful infrastructure that only charges me for use, and having in front of me a cache system capable of supporting any number of requests, however high it may be.

Hugo’s own deploy system allows me to clear this cache when content changes, so I can configure CloudFront to cache all content for 100 years, and minimize (even more) the cost of implementing this solution.

Similarly, if we prefer to use any other cloud provider, or even normal hosting, we can use it without problems, since the only thing we are publishing is purely static content.

In summary, a simple, easy to use and extremely powerful CMS that will make our task of publishing websites much more comfortable and simple.

macklus
Author