/   Basil Labib   /   blog

Updates to the blog

July 11, 2023

It has been quite sometime since I turned my attention to this blog. Not in terms of content but in terms of features and upgrades. It has served its purpose well, that is, helping a lazy blogger like me keep up with his habit :P. It doesn’t intruding too much in terms of maintainence, silently complementing my content, and giving me the peace of mind to blog while keeping it aesthetic for you.

And yet nothing is static. As the blog has grown, so has my needs and demands from the blog. It is particularly this part which justifies taking the hard road to maintain my own blog in this silent corner of the web and not on some popular writing community like Medium or Wordpress. The freedom to hack and control every single div on this website.

Well, if you have been following my blog, you’ll notice few changes. In no particular order, here are a number of upgrades / features added to the blog:

🕶️ Dark mode

Did you notice the shiny new button beside the page title? Yep, this blog is now dark theme enabled! My eyes will thank me for editing stuff late at night.

I took inspiration from this post and copied Dan Abramov’s button design CSS (Thanks, Dan for this and Redux!) Still had to figure out the dark mode CSS for each page etc.

The homepage looks like this:

I like it!

🗨️ Commenting system

After a long running feud with Disqus and trying to integrate a managed open-source commenting system on my blog (Looking at you Valine and Isso :/), I have settled for gitalk, a commenting system built over GitHub issues so I hope it will work properly. Only catch is you need to have a GitHub account to post a comment which I think you should if you don’t already.

⚠️ WARNING: If you’re using gitalk, then make sure your post slugs are less than 50 characters as gitalk somehow can’t tag issues with longer tags. 🤷 Learnt it the hard way.

Fixed that, now I should push to prod, right? Right??

Ugh….humbly goes back to VS Code.

After half an hour of reading gitalk docs, scrolling through SO answers, and (re)learning about HTML DOM manipulation with JS…tada!

This is how development is, breaking and building and breaking something else in the process. Do let me know if you notice something broken, I haven’t tested the new theme for everything :)

🔢 Mathjax support

This was purely on a whim as I wanted to write some ✨math✨. This is surprisingly easy if you just want Mathjax support ASAP and need to start using $$ $$ by importing a few stylesheets.

But as the SO answer points out, directly rendering Mathjax can be slow and show unwanted unstyled content before rendering which is sort of irritating. Thus, had to write a bunch of code to delay the visibility of mathjax blocks until it is rendered. Better but not sure how much I’ll use it as now I have to enclose all Latex content in Hugo shortcode blocks which are sooo clumsy to use :/

Maybe, I don’t mind a bout of FOUC after all.

Basil | @itbwtsh

Tech, Science, Design, Economics, Finance, and Books.
Basil blogs about complex topics in simple words.
This blog is his passion project.