kekePower

Having fun scripting and hacking Linux and Mageia

Updates on the script that builds this blog

I've spent a few days updating and optimizing the script that builds this site.

Over the past few days, I've been working on optimizing the generation time and other bug fixes on the script the I use to build this site.

One of the first things I did was to consolidate the link generation from 2 functions into only 1. This is because there are 2 types of links. External and Internal.

Then I did the same on the Image part. It is now possible to add images from any source and directory, while the standard image path is still /images/ .

After that, I began to tacle the slow generation time that the creation of the blogs took. It was just too slow and I started to imagine having hundreds of posts and how slow that would make it.

The solution is two-fold:
  1. All the blog files are now stored in an array
  2. New and updated files only are added to the array by having a cache with hashes of all the files

The next steps


There are still a few more things I want to improve and will improve over time. I'm having a blast and want to thank NikolaExternal site icon for the inspiration.

This script is in no way as great as Nikola, but it works for me and my needs.