Initiation & Hugo

Welcome to my blog! I know I know it’s a very stereotypical thing to say. Very much blogger style. But just be happy I didn’t start it with

console.log("Hello World!");

Evidently JavaScript fanboy in the room watchout! Well I used to have a wordpress blog but never really got into that. I found it too bulky and the actual wordpress UI too bad. So I waited a bit :/. In reality I was being lazy but now I really want to have a go at it… This blog is leaning more towards a JAMstack than the old wordpress… I like markdown files and I like the fact there is no real backend. It’s basically just a static site.

So as this is my first blogpost, I’ll give a small background to me and then I’ll give you an idea of my sweet hugo setup.

I’m just an average computer science student in the United Kingdom, who’s currently doing a placement year at a company. I’ve worked in tech before at a number of smaller startups doing all kind of things. I mostly program in languages like JavaScript and Python but I can also whip out some C and Java. In the future I want to progress and improve my knowledge of other paradigms of programming. I’ve already tried functional programming with the likes of Scala and Haskell. The next step I want to take in this direction is getting my hands dirty with Elixir and Erlang, they’ve tickled my fancy for quite some time. But before I do that I want to learn Golang. There are many reasons for this, some of which include: it’s a strong server side language, it’s being used to write many of my favourite modern day tools, it’s got hints of C and lower level programming and in general it’s not a scripting language. Also it was made by Google, that can’t be a bad thing can it?

So that’s a small paragraph to me, let me talk to you about the blog setup I’m running for this blog.

Technologies

  • Hugo (Static Site Renderer)
  • Hugo Template (Hyde-Hyde - I want to change this in the future)
  • git & Github
  • Netlify

Setup

For the templating engine I’m using hugo. I’m not sure why I chose this over the many other options I had, but it seemed simple, but also powerful at the same time. I also found that it was quite nice to setup and didn’t require any knowledge of Golang. I mean the other main contender is Gatsby, whose whole ecosystem evolves around react and javascript. I mean I can write react and JS but it seemed bulky and there were loads of plugins to do stuff for me. Whereas with Hugo I didn’t really need to worry about that it’s more a templating engine and for a blogging site it’s ideal.

I do plan on fiddling around with Gatsby, it seems interesting, my frontend framework of choice is React and many other reasons but I just haven’t got around to it yet.

Then after setting up Hugo and it’s template, I’ve setup a git repo on my github to host it all. The content, the project files and all.

Then onto the juicy part, Netlify. This has to be one of the coolest SaaS apps I’ve used EVER. It’s so easy to use, it’s extremely powerful, has a great free tier, and many other addons like free SSL certificates with Let’s Encrypt.

The way I’ve setup my CI/CD with Netlify is that every new push onto the master branch will trigger a new deploy on Netlify. It automatically pulls the latest code, then builds the Hugo files and hosts the static files!

I’ve done some vudoo magic with the domains and all but that’s a minor thing. Basically I’ve pointed a subdomain onto the Netlify domain I got given automatically, then Netlify gives me automatic https. Then lastly I have created a redirect from the automatic Netlify domain to my subdomain. All in about an HOUR. Which is amazing and crazy considering how much time this would take if you would have to do it yourself, with a Nginx/Apache server etc…

Anyways I think this has been a good post, now It’s time for bed and more coding tomorrow!

Leon