Jekyll 1.5.1 likes my timezones again
SoftwareAt some point in the most recent branch, my Jekyll setup began falling over itself with timezones in timestamps. I hesitated to call it a general bug, given I use Jekyll in a fairly custom way. In any case, this was a serious issue given I’ve written this blog from a dozen different timezones over its nine year history, including a couple that were more than 12 hours apart.
(To be fair, Jekyll still performs far better than WordPress ever did for timezones, particularly when I was living in Singapore and studying in Adelaide, Australia. My late night SQL adventures with that are for another post).
My solution, at the time, was to bypass the bug by moving the offending timezone to its own front matter “tz” attribute. This necessitated adding extra post.tz Liquid markup everywhere where dates were handled, then writing a custom date mask that didn’t convert the time to UTC, but supressing the automatically added timezone. It was a horrible hack, but it worked:
title: "Clara and Ruben's Singapore-KL-Tokyo-Seoul-HK-Taipei trip" date: "2014-04-05T11:33:10 tz: "+1100" hash: [goop]
With the most recent 1.5.1 release, I noticed most of my posts were off by a day. It prevented me writing my post yesterday, on account of not wanting to mess up timestamps for thousands of posts.
Fortunately, this failure was for a wondrous reason; Jekyll now recognises my timezones again! A quick regex to remove text and a newline, regenerate my post hashes, and my dates are now properly parsed:
title: "Clara and Ruben's Singapore-KL-Tokyo-Seoul-HK-Taipei trip" date: "2014-04-05T11:33:10+1100 hash: [different goop]
I’ll be marking my earlier hack post as hysterical historical. Thank you Jekyll team and contributors, you made this guy’s day :”).
K-On! promotional movie artwork © Kyoto Animation 京都アニメーション