Marcel Kapfer

There are currently more important things than this page. Please take a moment to show your support for Ukraine.

Ukrainian flag with dove and text: SUPPORT UKRAINE END WAR

Find out how YOU can help!

How this post is brought to you…

2022-01-12

518 words, ~ 3 min reading time

100DaysToOffload emacs orgmode hugo

The #100DaysToOffload challenge starts very well. I’m sitting here at my desk with the to-do in front of me to write post number two. And I have absolutely no idea what to write! Well, there are some topics I want to cover on the blog during the next months and the can be part of the #100DaysToOffload but I currently don’t know where to start. So what’s left then to tell you, dear reader, is how this blog post is brought to you and thereby also include a few hints about what I will write during the next months!

So about that workflow. Let’s start the same way that I work with it. Currently I’m running my older Lenovo Y50-70 laptop with Windows 10 since I like to do creative stuff like graphic design or editing photos and therefore rely on software that is not available on UNIX/Linux. However I’m mostly a Linux user and a few years back I fell in the large Emacs rabbit hole and can’t get out. So for starting this post I open my Debian WSL2 instance in Windows Terminal and fire up that old editor with setsid emacs. A few seconds later a white rectangle pops up on my screen (I have VcXsrv installed) and I can navigate to my blog.org file in my website repo.

Once I’m there I create a new headline, set two properties: an export file name and an export date, add the #100DaysToOffload category and start writing (or at least I would if I knew what to write). Once that is done I need to manually run (require 'ox-hugo) since I’m quite lazy and never took the time to load this automatically using my Emacs config. But what is ox-hugo? Well, ox is short for org export and hugo is a well-known static site generator. So ox-hugo lets me export my large blog.org file containing all my blog posts to files that hugo can understand. If I’m done writing I exported the new post, run hugo serve in the terminal, visit localhost:1313 in my browser and verify that the content and markup is to my liking. Once I’m satisfied I can upload the changes I made to my website using a hacky script I wrote and spread the word on Fosstodon.

But there are somethings that I would like to optimize. Adjusting my Emacs configuration like written above is just one thing. Another is that it is currently quite cumbersome to create a new blog post. A template, e.g. using org-capture or similar is something I want to investigate in. And I really need to put some time in the publish script…

If you made it this far: Congratulations! You survived this quite technical overview and are ready to read more about my workflow in the future! If you just scrolled to the end: that’s also fine. While I can’t promise it, I don’t think that all of the 98 blog posts that are left will be that technical. And if they are they will explain the stuff I write about.

Day 2 of the #100DaysToOffload challenge.

I would like to hear what you think about this post. Feel free to write me a mail!

Reply by mail