About this site
There are two main reasons I built, and continue to maintain, this website.
- I wanted an unrestricted online space to write and display whatever I like
- It was an interesting project for me as a technology nerd, and it can be done at very little cost
Of course, convention is that now I have described myself as a technology nerd, I have to explain what technologies are behind my site. Here goes:
A longwinded and probably needlessly wordy explanation of the technology behind this site
This is an entirely static site. When you go to a specific page on this site, you are simply receiving an HTML document that is already stored in complete form on the server. This is in contrast to a dynamic site, where the HTML document you recieve is generated in real-time by the server in a process called ‘server-side rendering’ before being sent to you. The fact that the server has a much simpler task to do makes static sites both cheaper to operate and faster to use than their dynamic counterparts. In this case, the provider of the server is GitLab, which is first and foremost a provider of Git repository hosting. I prefer them to the leading provider GitHub for many reasons - the one pertinent to this topic will become clear shortly. What you need to know for now is that they have an excellent feature called GitLab Pages, which allows any user to host a static site free of charge based on the contents of a repository.
You may notice that almost every page on this site follows one of a few templates, and they are all styled similarly. That’s where Nanoc comes in. Nanoc is a static site generator (SSG) - a piece of software which takes files, each representing a page of the site written in Markdown, and writes fully completed HTML files ready for our server to host, with the content inserted appropriately into a template. If I want to change something in either the template or the content, I need only edit one file and run the SSG again, and everything will be regenerated to match. This brings me onto the specific reason I use GitLab over GitHub - GitLab will handle the running of the SSG as well as hosting the site. With the correct configuration, it can detect changes to the repository content and automatically run Nanoc to update the version of the site that is hosted.
The site also uses Cloudflare’s Content Delivery Network (CDN). The basic idea of a CDN is that rather than all requests for pages on a site going to the main server, many go to one of a collection of Cloudflare servers distributed across the world. This makes the site significantly faster, especially if you are located close to a Cloudflare data centre. You can read more about what it does and how it works here. Cloudflare also provides some analytics which allow me to count things like how many times any given page has been viewed (note that this happens entirely on the server side and does not collect any of your personal information).