software is still awful
In my year of absense from writing anything here at all, it wasn’t necessarily only because the year was awful - although it kind of was, not just for the world at large, but also for more personal reasons – a subject for another post, or perhaps not.
Regardless, when I did eventually turn my attention back here, I managed to come back to find that Jekyll could no longer generate the same blog I left - even without any alterations or new content.
I first found out that jekyll couldn’t tell the time. In the less destructive cases, I had posts that were being timestamped an hour or two off where they should have been. In worse cases, they were a full day off the correct times. Sigh. I searched around a bit and I can now confirm, in case you were wondering, that dates and times are still awful in software.
I don’t know if that is precisely the issue I hit (because again, I just wanted
to move on past all this and start actually doing things), so my workaround was
to just remove dates off everything, because really, who needs to know what
time of day I write things anyway. One
s/([0-9]{4})-([0-9]{2})-([0-9]{2})T.+Z\'/\1-\2-\3'/
later, and my posts were
pretty much as they should be. I have to ask, though, why in the actual fuck
does a static content generator like jekyll care about timezones? The dates
and times I give you are the dates I want displayed.
Oh, and for whatever reason, before I could even try to generate things, I had to
gem install jekyll-paginate
and add gems: [jekyll-paginate]
to my
_config.yaml
- I don’t know what caused this (I didn’t bother to do my
homework, as the solution was easy enough). I’m sure this was a change made with
the best of intentions, but it certainly wasn’t helpful when I’ve already been
struggling with the motivation to write anything at all.
Once I got past all that, though, it wasn’t all bad. I finally fixed the Makefile I use to write here to automatically generate title metadata for Jekyll (one less piece of friction involved in writing a post):
post:
$(eval POSTTITLE ?= $(shell read -p "Post title: "; echo $$REPLY))
$(eval POSTTITLE_ESCAPED ?= $(shell echo "${POSTTITLE}" | sed 's/ /-/g'))
$(eval FILENAME := $(shell date +%Y/%Y-%m-%d-${POSTTITLE_ESCAPED}).md)
mkdir -p _posts/$(shell date +%Y)
cp _drafts/.template.md _posts/${FILENAME}
sed -i '' "s/\%TITLE/$(POSTTITLE)/" _posts/${FILENAME}
sed -i '' 's/\%DATE/$(shell date "+%Y-%m-%d")/' _posts/${FILENAME}
vim _posts/${FILENAME}
I’m sure this isn’t ideal somehow, but I didn’t want to deal with some kind of exotic language or system with dependencies back when I started, so I’ve just been gradually making this more arcane to (somehow) accomplish what I want. I don’t have a clue about Makefiles, so this is all trial-and-error. So sue me.
It’s still not perfect, because it means when I want to rename a post (which happens a lot after I start writing, as I did a few times on this post even), it means that I have to figure out how to do the escaping for the new filename, locate it in the awfully structured directory tree, and remember to change the title attribute. But I suppose this is the price I pay for not using a fancy web interface anymore.
Not that I miss the complete shit that blogger’s web interface generated instead of writing my posts in Markdown.
I think next, I want to figure out how to generate tag-based archives again – I
did some initial research and it doesn’t look too difficult, just a matter of
actually trying it out. And then I need to start actually using tags again, and
maybe making the Makefile
nightmare even worse, to help me tag a post.