Tidying up

Posted on: 3rd January 2021

Apologies to anyone who is subscribed to my feed and saw old posts loading up multiple times. It should stop with this new post.

Browsing the local timeline on Fosstodon led me to Amolith looking for a solution to tidy up html generated by static blog engines. This piqued my interest because I wasn’t too happy with the amount of empty space in the HTML generated by Jekyll and I am always on the lookout to reduce the strain on my Pi. My page is not resource heavy (just under 4KB uncompressed) but every millisecond saved helps. I found couple of solutions but only one that integrated with Jekyll - jekyll-tidy. This is how the addition to my configuration file looks now.

...
jekyll_tidy:
  exclude: []
  ignore_env: nil
  compress_html: false
...

The stylesheet is a little dense after adding this gem but still readable and can be excluded with '**/*.scss'. ignore_env is nil so that I can preview the changes locally first. compress_html is false to beautify the html. A true value will minify everything. This project however is in a semi-abandoned state. The stylesheet enhancement has not been merged yet and so has passing options to the HTMLbeautifier which does all the work. I am using it anyway because this fixes unnecessary spaces and makes the html a bit compact.

Day 66 - Join Me in #100DaysToOffload

tags: 100daystooffload jekyll