Blog reincarnation

Historically, on my site, I usually run around new exciting technologies, and in this article, I will describe another such experiment to update my website.

As it was before

Once upon a time, at the very beginning, the site worked on my own Alroniks CMS, then there was the Dockpad static sites generator (the project died) after there was an attempt to launch the site on MODX, but it was unsuccessful. For a while, the site worked on Laravel, but I was tired of serving it too. I tried using Ghost, and it turned out that we had some natural incompatibility with JavaScript.

It would be possible to take Wordpress and not bother, but for it, you need to buy and maintain hosting. I wanted something simple with minimal cost. The static generator, in this case, is an ideal solution. The Hugo was selected for the new version as a high-performance, written in Go language, generator with a vast number of functions and capabilities.

There are a lot of such generators now, and you can found them in the programming language with which you are better acquainted, and I would recommend doing this. I chose to Go because I like this language, and my last pet projects are written mainly on it, even though the main working project uses PHP and JavaScript primarily.

Also, do not forget about Jekyll, one of the first and probably the most successful generator of static sites. But it did not suit me since I do not intersect with the Ruby world at all. In the appendage, it was essential for me to ensure the work of the site in two languages, Russian and English, and it seemed more challenging to implement mine needs with Jekyll. Therefore Hugo.

Why exactly the generator

The beauty of a static site is that it does not require anything to run, as it is a set of ready-made (generated) HTML pages. It is enough to place them somewhere on the Internet, and that’s it. For this purpose, any file hosting is suitable with the ability to bind a domain name (you can and without). I know examples about sites hosted on Amazon S3. There are also exist specialized services like Netlify, as well as free GitHub Pages.

The second important point is the version control system. In the case of a static site, under version control, you can keep both the sources of the site itself and its generated copies. It allows you to use git to track the entire history of changes to see what data has changed in the process, which significantly simplifies the search for possible mistakes. Collaborating on content is possible also thanks to VCS.

And the third aspect is the text editor. The whole site contains only files, which means you can use any convenient editor on any operating system.

How does it work

The site content represents files in Markdown format. These files and configuration files for Hugo hosted in the source-klimchuk repository. Everything related to the design of the site, i.e., styles, some javascript scripts, images, and additional service files have moved to a separate repository with a theme — hugo-theme-klimchuk. It is done to do not mix technical and content changes in history and to provide the opportunity to work on the design and content independently.

Generated copies, one for each language, are placed in their separate repositories on GitHub. GitHub Pages supports only one domain per repository, and I have to have two of them. In general, Hugo supports multilingual sites, and it would be possible to do everything on one domain, but with subsections of the form site.com/en, but I like it more when klimchuk.by is entirely in Russian and klimchuk.com is in English, so I had to complicate the circuit.

To be able to write notes for my site conveniently, I use the Forestry service, compatible with Hugo sites (there is support for other popular generators). It requires additional configuration, but the step is optional, any text editor can handle it.

Such a distributed system of repositories and services implies the need for automation, and of course, I implemented it. In short, everything works thanks to CircleCI, which tracks changes on GitHub and starts the assembly and publication of site pages. I’ll tell you more about site automation in the next article.

A few words about the content

Previously, the site was a simple blog with notes and a few words about myself, but in the new version, I decided to expand and separate substantially different areas of my life. Now the site has three broad sections: Notes, Places, and Projects — several words about each of them.

Notes

This section practically did not change but migrated from the old site. It is a regular blog, where there are notes posted in several categories.

Places

It is a new section in which I decided to separately collect notes and photos of the places I have ever visited. As a rule, these are trips with family or business trips, as well as cycling trips of an unsportsmanlike type. The list will be gradually replenished over the past years, but rather for myself, so as not to forget.

Projects

This section has not yet presented on the site; however, in my free time, I actively do something new as a hobby and want to share it. Here I will describe in detail the projects themselves, how I did them, and why. One of the latest such projects is pravilna.by.

In a sense, I am doing the current version of the site according to the principles of agile, when MVP implemented, and then brought to an acceptable state. So it’s entirely possible that over time, new sections may appear, and old ones may disappear.

To be continued.

It took 5 minutes to read The note contains 941 words