Blogging work

Contents

Split the QRetail content out to its own blog

My main project this week was splitting the QRetail content in my notebook files out to a separate blog. Recall that the source data for this blog comes from a large Markdown-style notebook file I maintain, with a program (mk-blog-content) identifying blog entries and splitting them out to individual files that the nikola software uses to build the blog.

Not only did I have to update mk-blog-content to split content out to two different blog directories (the main one and the QRetail one,) I also had to re-work how the time for each entry was assigned. Due to the way I structure the notebook file with one major section for each week, individual entries don’t necessarily have a date on them, let alone a time. mk-blog-content assigns more or less arbitrary timestamps to entries, but they need to be sequential. If they aren’t, reading the QRetail blog is even more confusing than it already is because the entries are ordered haphazardly.

While my main blog usually gets two or three entries a week, some QRetail content generated up to twenty! Because the QRetail blog can generate more than seven entries in a week, I couldn’t simply put each entry into its own day—some days might get as many as three. So I needed to maintain counters for the number of entries each week and the number of entries generated for any given day, then use that information when computing a time to give an entry. And the timestamp has to be computed somehow and not random, first to preserve the sequential order, and also to ensure nikola doesn’t rebuild a blog entry because its timestamp randomly changed.

I decided to use an entirely different theme for the QRetail blog. I downloaded and evaluated two:

  • maupassant
  • foundation6

It was a real toss-up as to which one I liked better, but in the end foundation6 won out because I preferred its light blue colour scheme to maupassant's grey.

After getting the content formatting correctly, I had to re-visit all the QRetail entries—270 of them—and update them with a better set of tags, then review everything to ensure all was appearing as expected.

Test five years worth of content

In addition to QRetail work, I also started on another part of the blogging project: determining the back content to include in this blog. I’ve done a lot of things over the years that I’ve found interesting, and I wanted the blog to reflect that. But I wanted to test how well both mk-blog-content and nikola handled a lot of entries, to ensure updating my blog didn’t turn into a half hour processing job every time I added an entry.

I developed a progam to mark every entry in my notebook files going back to 2015 as bloggable content. This was actually a bit of overkill, since I suspect only about 30%-50% of the back content will actually end up in the final blog.

With over 600 blog entries over five years, mk-blog-content runs in less than a second to generate files for both blogs, and nikola spends only about ten seconds determining which files need to be reformatted for the changes. When that’s done I should be able to use rsync to upload the content to my hosting provider, once I figure out who to use for it.