New Blog Migrated from SubText to Jekyll and hosted on GitLab
Finally migrated off SubText blog engine and migrated to a static generated Jekyll format hosted on GitLab Pages. Pretty sweet so far. I can finally decommission that noob-ish blog of mine.
The main benefit of migrating to Jekyll is having the ability to write Markdown for my blog posts. I’m a big fan of Markdown; especially GitHub flavored Markdown.
I originally tried hosting the blog on GitHub Pages but found some limitations. For one, your repository must be public; not private for GitHub pages to work. I prefer to keep my blog source private for now; so the GitHub option was off the table.
Luckily, GitLab has a similar feature called GitLab Pages. GitLab Pages works just like GitHub Pages except you can keep your repo private.
Migrating from SubText wasn’t easy. The migration took several days. In general, the steps I took are as follows:
- Export the SubText blog to BlogML/XML format. Make sure SubText is updated to the latest version before extracting your first export.
- Next, I followed the instructions here for GitLab pages.
- I forked the https://gitlab.com/pages/jekyll example repo.
- Added minimal-mistakes gem gem to the fork by modifying the
Gemfile
. - Configured
_config.yaml
.
- Read the Blog ML/XML format and extracted the blog content to the fork’s
_posts
folder. The SubText/BlogML XML content is base64 encoded. After the base64 decoding, I then used Pandoc to convert the HTML into Markdown.- @pcibraro’s
BlogMLtoMarkdown
provided a great start on the process. - Extracted the comments from BlogML/XML and wrote them out as YAML files. Basically, I’ve followed the
staticman
YAML format. - Extracted redirects from the old blog so I wouldn’t break permalinks. I had to add a jekyll redirect gem.
- @pcibraro’s
- Modified the dark theme heavily.
- Modified the code highlight heavily.
- Added Google Tag Manager.
- Added Google Analytics.
- Added reCAPTCHA v3 - Invisible.
- Create my own version of
staticman
in ASP.NET Core. Basically, the code processes blog comments and verifies the invisible reCAPTCHA tokens anytime someone leaves a comment.- If the reCAPTCHA score of the comment is > .89, I don’t moderate the comment.
- If the score falls between 0.5 and 0.89, a pull-request is created for moderation.
- If the score falls below 0.5, the comment is rejected.
The motivations for writing my own self-hosted ASP.NET clone of staticman
was:
- The public server for
staticman
is API rate-limited by GitHub. - Doesn’t work with GitLab.
- Requires exposing a REST endpoint with
node.js
.
For now, I’ve tentatively named my ASP.NET Core clone of staticman
, ButlerBob
. I’ll probably open-source it soon.
In the end, lots of work. Happy to be blogging again.
Leave a comment
Your email address will not be published. Required fields are marked *