Well! I'm officially pretty happy with the fruits of my labor. It's not the prettiest, aesthetically or in terms of code quality, but hey, it does exactly what I want it to. Now I can use GitHub Gists as the backend to my blog - at least until I hit 3000 gists. I count that among problems I probably won't have to deal with, including:
- Getting slashdotted / hackernewsed
- GitHub changing their access model for public gists
- GitHub rate limiting me
- Having more blog posts than I know what to do with
- Having more viewers or subscribers than I know what to do with
I'll deal with those problems as they come. In the meantime, a quick rundown of what changed since the last post:
- Uses more semantic html: Basically each gist is an
<article>
and each file in the gist is a<section>
in that<article>
- Faux permalinks: The entire blog will load every time, so I just had to figure out a way to focus in on the article that was actually linked. To that end, I used
scrollIntoView
. At first, I usedfocus
, but it was giving me issues - I suspect it had to do with dynamically adding the elements, but it still didn't work even after waiting (or doing it manually), so I just found a method that did work.
In a week, when I can't understand my own code, I might rewrite it into something more declarative, which would be neat. Something like: