For the last couple of days I’ve been rewriting Micro.blog’s GitHub backup feature. It’s looking good, and sets the foundation for doing much more in the future. The backup will also now run automatically every day instead of once a week!
What’s this feature about? Here’s an example of how I use it for my blog.
Click on Design, you’ll see a “GitHub repository” field. I first went to GitHub and created a new public repository called “manton.org”. It can be called anything. Make sure to click the “initialize this repo with a README” checkbox so the repo is ready for Micro.blog to use.
GitHub might feel a little technical and overwhelming, but don’t let it scare you off. You don’t need any programming knowledge whatsoever to use this. It’s effectively just a free, external archive of files, supported by a company that isn’t going away.
Now back on Design, enter the repository name. Micro.blog will redirect you over to GitHub to approve access to your account. That’s it! From now on, about once a day, if you’ve added any new blog posts or photos to your blog, Micro.blog will commit and push them up to GitHub in these files:
- index.html — not just your home page, this includes every blog post with Microformats markup
- feed.json — also includes your whole blog in JSON Feed format
- uploads — a folder with all your photos, videos, podcasts, and other files
This structure follows the Blog Archive Format.
The old implementation of this only used the GitHub API. The new version does still depend on GitHub for signing in, but most of the plumbing has been rewritten with standard Git commands, meaning we can adapt it for other services like GitLab or Codeberg in the future. It also more efficiently wraps up commits into batches of 10 files each to simplify large pushes.
There’s also a change in whether files are ever deleted from a repository. Now if you delete an upload, like a photo, Micro.blog will also delete that file on GitHub.
I’m always sad to see people leave Micro.blog if they choose to take their files elsewhere, but I am not sad when everyone has good backups of their blog. We have exports in multiple formats, an open API for building tools, automattic ping to the Internet Archive, and this updated GitHub backup. Happy blogging!