Two months ago, I started one of my blog's biggest refactoring: separating the processing of my Ghost data from the generation of the blog itself. Rest assured, it did not take me two full months as I made the changes in my spare time. ๐
The end goal of this refactoring was to improve the build time of my GitLab CI pipeline. Let's see if it was worth it. ๐ค
On average, the pipeline on my default branch main
took 8m 30s and now, it completes under 3 m 41 s! So, it is now about 56,6% faster! ๐
It is a huge improvement, but when we considers the time it takes, we can seriously question its relevance for good reason. Although if I spent more time than I would have liked, I consider that refactoring to be an investment because this project had some positive side effects that I did not initially expect. ๐คญ
Side effects
Bug fixes
To make sure that I had not introduced any new bugs, I started comparing the HTML output produced . To my surprise, it was exactly the opposite: I unconsciously fixed bugs that I did not know I had! ๐ฎ
I hope the fixes will improve my SEO! ๐๏ธ
Dates and time
In the previous version of my website, I noticed that sometimes, some posts published late at night had the next day as their publication date... Sounds like a time zone issue, right? ๐
Now, all dates are converted to the America/Toronto
time zone, which corresponds to my local time, here in Quebec: the Eastern Time Zone (UTC-5). โ๏ธ
It is quite simple in JavaScript to do this with the native toLocaleDateStringfunction on date objects:
Also, I do not remember how I used to calculate the reading time before, but I noticed that some of my posts saw their reading time value drop drastically, like my Lint PowerShell scripts with PSScriptAnalyzer post which went from 12 minutes to just 3 minutes, which looks more correct. ๐
Greener website
As I use less of the ressources provided by the GitLab infrastructure to build my website, it uses less electricity and therefore, is a bit greener than before. ๐ณ
Also, I do not know why, but the new version of my website is now 3% more cleaner than the previous version according to the Website Carbon Calculator. ๐งฎ
Maybe it is because I deleted all the code and images related to the Apple iOs splash screens. So sorry to Apple users who are reading this post now, it is not worth it for me to serve 20 images and 4,252 more characters to everyone just to support one device type! ๐
While we are at it...
I also made some little improvements, but I am not sure if we should consider them as side effects. ๐ค
JSON feed
As my data for my Atom file was already in JSON, I took the opportunity to generate also its equivalent in JSON: a JSON feed. It was something that was on my watch list and while I implement it, I really like the specifications, which are much simpler in my opinion, than the RFC 4287 - Atom Syndication Format document.
I am not sure if feed readers already support this new format created in 2017, but it does not cost much to support it. It also helps promote a new format to everyone, and helps it to be implemented by more people and businesses. โจ๏ธ
Tag page
Even though each tag page uses a card format for their related posts, their layout was not great as the cards used the full width of the screen to be displayed. Now, the layout is almost identical to the homepage and the cards will be much easier to read, as their width cannot be greater than 65ch (approximatively of 1250px on my screen).
Tags page
And while we are at it, I have always wanted to have a page that lists all the tags I use. It is now done on my Tags page. ๐ง
It also reveals some interesting statistics to me, like the fact that I blog more about GitLab and Eleventy, based on their cumulative reading time! โฑ๏ธ
Conclusion
Enough changes for now, it is time to take advantage of theses new improvements and above all, to enjoy the summer! โ๏ธ
Top comments (0)