Table of Contents

1 My Blog/Phlog Workflow

I only started really writing anything down with intention for myself in the past few months. I'm slowly trying to ramp up and write a bit more.

I'm a very talking oriented person if that makes sense, and I find it difficult to write things that I think are coherent. I also tend to be a rambler in person who constantly over-explains. This also doesn't translate well to writing.

To that point, I think part of why I talk so much is because it helps me organize my thoughts. They rattle around in my head in an incoherent jumbled mess and spewing them out helps me to hear what they actually are.

However, it's not always easy to talk to people. Maybe people aren't around, maybe they don't want to talk, maybe they do but not about what you want to talk about, etc etc.

To that end I figured I should try and write more things, even if no one ever reads them, just so I can practice that act of thoughtfulness and trying to codify my thoughts.

Preamble aside, I figured I'd write something about my blog posting infrastructure which may be of some interest. I have two places I post my blogs:

Because the files that represent the blog posts for these platforms are pretty different, I needed a way to be able to write a post in a comfortable, ergonomic way and then "deploy" it to the various places I want it to be visible from. Here's what I came up with:

I write my blog posts in Emacs, in org-mode. I like org-mode and use it for other stuff, and it's an environment I'm comfortable with. Additionally, I can export org mode documents as HTML, which helps a lot.

So after I'm done writing my post, I save my .org file, and then export it to HTML.

From there I do some minor edits on the HTML manually. This is just to update some <style> tags for the HTML version so that it's not so utiltarian. If I understand correctly, there should be a way to configure org so that it puts my <style> values in, but I'm not sure how to do that yet. Something to look into later.

After I tweak the HTML file, I now have 2 files:

  • blogpost.pretty.html

Typically I still have both of these open in buffers in Emacs, so I wrote a little elisp shell wrapper to shell out to rclone, which posts the file in the buffer to a bucket in BackBlaze B2.

Every few minutes on my respective servers, a little script runs that gets any new blog posts.

On the HTTP server it grabs the .pretty.html file, and on the gopher server it grabs the .org file, and places them in their respective places.

Once this is done, the script uses to send me a notification that the files have been deployed.

To review, the process essentially looks like this:

Write in emacs -> save as .org file -> export .org as .html -> modify html <style> -> upload to B2 -> wait a few minutes.

I can do all of my blogging from Emacs without ever having to touch anything else, and I get a notification on my phone to confirm that the blogs have been uploaded successfully!

I really like this system, and because it feels easy to use for myself, I find myself blogging more and more!

Thanks for reading!

Created: 2022-01-21 Fri 16:24