klh.io

Maciej Sopyło

Hello World

19:51, 24.02.2019 +0100 · 621 words 3 minute read

For a while now I wanted a space where I could share my thoughts and knowledge about various programming topics. I’ve always liked writing - educational pieces in particular, so apart from a few rants and reviews here and there you can mainly expect tutorials and courses in here.

As for the topics at the moment I’m mainly a front-end developer (React, Vue, Angular, React-Native, Flutter) but I also do back-end with Node.js, Python, some Ruby and Erlang/Elixir from time to time. Basically whatever technology I find interesting I’ll try to write something about, but Javascript will be the most frequent one. I also like hacking / DIY so I’ll definitely write about electronics, CAD and 3D printing as well.

Technology Overview

I decided to use a static site generator for this blog - it’s easy to host, SEO is amazingly simple and I don’t really have to worry about securing anything since it’s just a bunch of HTML. I had a few requirements:

My first choice was Jekyll and GitHub Pages due to it’s ease of use - you just push to the repo and GitHub does everything for you. The tradeoff is that you can’t use any plugins not supported by GH Pages and the versions are locked-in too. This meant that, for example, I couldn’t use the newer pagination plugin and the default one was too limited for my use, so I moved on.

After trying Jekyll I decided to write my own using TypeScript with JSX,  nicojs/typed-html and  mozilla/nunjucks for templates. Rolling my own allowed me to easily integrate things I needed into the generator - for example standard markdown syntax was compiled to AMP HTML by default. After spending two weeks working on it I had pretty much everything I wanted, but pagination turned out to be a much bigger problem than I originally thought. It seemed that with my approach I’d have to do multiple passes in order to get all the data I needed, so I decided to stop until I thought of something better.

While my own project was really fast compared to Jekyll, I had nothing on Hugo - the same content was compiled three orders of magnitude faster. Along with really nice taxonomy support and ability to extend markdown with shortcodes it’s a clear winner (at least until I sort out my own generator). It’s written in Go and while the templates are a bit more complicated than nunjucks (mainly due to Go templates using normal Polish notation for function calls) it allowed me to do everything I needed without much hassle.

Everything is hosted on GitLab Pages - thanks to their generous 2000 free monthly CI minutes you can use anything you want to build a static website and they even provide config templates for popular generators that you can just fork to get started.

I decided to go 100% AMP because I believe that a simple blog like this shouldn’t have too much bells and whistles - the content is what people (hopefully) come for. Even though AMP has mobile in its name there are benefits to using it on the desktop too: the page loads immediately even on slow connections and additional rules imposed by the framework make it easy to keep the UX consistent.

At some point I also want to provide the ability to comment on the articles - I’m thinking about using Staticman since it integrates nicely with my git-based workflow and doesn’t have any weird tracking / analytics / cookies, but I’ll have to figure out how to deploy it properly.

I hope you will find the content here useful!

announcement