For those who work with IT, it is very interesting to have a blog, in a way it is a documentation of their learning, it gives strength to the curriculum and also helps the community.

What is a static blog?

I’ve used Wordpress a lot and the performance is never that good and not to mention that you need a database and a web server with PHP support, too much for a simple blog, don’t you think?

A static blog doesn’t need any of that, it generates the HTML, CSS and Javascript files and that’s all it needs to work, which makes the site incredibly fast.

Never before with Wordpress did my blog get this result:

Pagespeed
Performance testing with static blog

What is Hugo?

Hugo is a static HTML and CSS website generator written in Go. It is fast and easy to use, it takes files in a directory and convert them into a complete HTML website.

Creating the blog

Before we start it is necessary to install Hugo, it is a simple process but as it will vary according to the operating system you use, follow the instructions here to install.

With Hugo installed we can create the blog with the command:

hugo new site blog

Hugo will create a blog folder in the directory with the files for the site, but we still need to choose a theme.

You can choose any theme here, in this tutorial I will use Etch.

To do this, run the commands:

cd blog
git init
git submodule add https://github.com/LukasJoswiak/etch.git themes/etch

Go back to the project root folder and config.toml file and add the following line:

theme = "etch"

Now you can run the server in development mode with the command:

hugo server -D

Creating your first article

A blog is nothing without a post and to create your first post just run the command:

hugo new posts/hello-world.md

This creates the file in content/posts/hello-world.md with the following content:

---
title: "Hello World"
date: 2022-03-02T17:17:22-03:00
draft: true
---

Hugo uses .md files that use markdown for their content, just edit and change the draft option to false, you can also add the author and tags and that’s it, post published.

---
title: "Hello world!"
date: 2022-03-02T17:17:22-03:00
draft: false
author: "Diego Rodrigo"
tags: ["tech", "golang"]
---

Post content.

See how easy it is, now just host your blog on a platform like Netfly or AWS Amplify and be happy😁.