I did a bunch of work on the new version of the blog (Jekyll 3, clean dark theme), converting
all but the middle thirty posts; but more importantly, I did some long-overdue automation of the
process using
RegReplace.
It took a little bit of doing, but the sequence of heavily regex’d find-and-replace tasks are now
a single Sublime command.
{"format":"3.0","replacements":{"octo_to_jekyll_backtick_codeblock":{"find":"``` *([\\S]+) *([^\\n]*)\\n([\\s\\S]+?)```","replace":"{\% codeblock lang:\\1 \\2 %}\\n\\3{\% endcodeblock %}"},"octo_to_jekyll_backtick_newline":{"find":"\\n+```([\\S\\s]+?)```","replace":"\\n\\n```\\1```"},"octo_to_jekyll_backtick_plain":{"find":"\\n```\\s*\\n([\\S\\s]+?)```","replace":"\\n``` plain\\n\\1```"},"octo_to_jekyll_center_img":{"find":"{\% center left ([\\S]+)\\s([^%]*) %}","replace":"{: .center-image }"},"octo_to_jekyll_noncenter_img":{"find":"{\% img left ([\\S]+)\\s([^%]*) %}","replace":""},"octo_to_jekyll_heading_newline":{"find":"\\*\\*\\*\\n\\#","replace":"***\\n\\n#"},"octo_to_jekyll_single_cat":{"find":"\\ncategories:\\s*\\[\\s*([^,^\\]]+?)\\s*\\]","replace":"\\ntags:\\n - \\1"},"octo_to_jekyll_two_cat":{"find":"\\ncategories:\\s*\\[\\s*([^,^\\]]+?),\\s*([^,^\\]]+?)\\s*\\]","replace":"\\ntags:\\n - \\1\\n - \\2"},"remove_trailing_spaces":{"find":"[ \\t]+$","replace":""}}}
(Note: The percent sign is only escaped here to keep Jekyll from processing it.)
Default.sublime-commands
1
2
3
4
5
6
7
8
9
10
{"caption":"Reg Replace: Convert Octopress 2 blog post to Jekyll3 custom","command":"reg_replace","args":{"replacements":["remove_trailing_spaces","octo_to_jekyll_center_img","octo_to_jekyll_center_img","octo_to_jekyll_single_cat","octo_to_jekyll_two_cat","octo_to_jekyll_backtick_codeblock","octo_to_jekyll_backtick_newline","octo_to_jekyll_backtick_plain","octo_to_jekyll_heading_newline","remove_trailing_spaces"]}},
Now I’m comfortable to say I can do the switch-over in the next week or so.
One of the overdue items on this project is some sort of continuous integration. It’ll be awkward
with the legacy Windows server, but probably worth it. For now, though, let’s just get the ball
rolling with some test code linting.
I’ve used
Travis CI quite a bit professionally, but since we’re on GitLab for this,
I thought I’d give their new CI offerings a try. I created a .gitlab-ci.yml based on their
example code:
I pushed it up, and… nothing. No errors, but no building. Experimented on some other repositories,
and it was just this one that was ignoring my CI config. After a lot of poking around, I found the
problem:
Project Settings -> Feature Visibility -> Repository -> Builds was set to Disabled, which I must
have thought was a good idea at some point. Once I made it anything else,
Rubocop was run as expected.
As nostalgic as I sometimes am for “the good old days”, I feel terribly constrained by
eighty-character lines. One hundred seemed a nice round number, so I’ve settled on that.
Well, Rubocop’s certainly given us plenty of work to do. Tomorrow.