How i did it

+
hugo is awesome
hugo is awesome

so it begins

For a long time I was struggling with creating a website in a simple way without jumping trough burning hoops with my hands tight around my back.
I tried Wix and hated it. Also tried WordPress and hated it even more.

And mostly I didn’t want to go to the dark side of using blogging platforms with dodgy earning models like Medium. Since I’m planning on writing a book and the post on my website are the beginning off this book, I had to find a proper way of doing this.

the choice

I knew about static site generators for a while, but never came around in trying them. (like always no time to do it properly, lots of time in failing with shitty solutions)

So now I decided to just do it. As always the scope creeped from trying Hugo to create a website, to full CI/CD deployment of the site with Ansible on Azure centOS linux box. In this post I will show my more realistic approach. The much dreaded MVP, but at least it was a working site. (I will post about that journey in another post)

use hugo

Start with installing Hugo. This is as easy as: brew|dnf|apt-get|choco install hugo just choose your favorite package manager. Check the instalation with the command hugo version.

Create a site f.i. in the folder kakfelota with hugo new site kakafelota. This will create the folder structure for your Hugo website.

Next you will have to add a theme to the theme folder. You can choose a theme here but at first Ananke is a good theme to start. Check the demo site.

In the config.toml you can set the correct values for your site.

Ananke comes with a sample site you can use to play with content and settings.

test

hugo server -D runs your site on your local machine. You can immediately see the results in your browser http://localhost:1313/. You can live edit your content and when you are satisfied you can publish the site.

publish

hugo -D will create your static website in the `public` folder and you can upload this to your web server. Also, this is what I tried to do with Ansible, but for now out of scope.

So I choose to push the configuration to GitHub and publish to Render. A Render web service takes the configuration from GitHub, generates the static site and publishes it.

Downside is that your URL is something like kakfelota.onrender.com, but you can bring your own domain. Setting up the DNS is not always easy with every provider, so I used the Cloudflare DNS and naming servers (and even moved my domain to Cloudflare).

Alternative deployments are in the Hosting & Deployment pages.

interested

All this is documented in the Hugo quick-start guide. Some knowledge off git, mark down and being comfortable in using a command line is required.

I used Visual Studio Code for editing and the Hugo extension