📌 Pinned: Treat all vulnerable road users as if they were your closest family. Maintain a safe following distance from the vehicle in front (at least 2 seconds).

Using org2blog to publish Org-mode/Org-roam notes

In

Tags:



by

1. Why I want to do this?

I am using Org-mode and Org-roam to take notes, and sometimes I want to share the notes with people, exporting them as HTML should be a reasonable way to achieve that. The result of default Org-mode HTML publish looks fine for me, I like their headline numbering output, and I am also seeking about how to prettify Org-mode HTML result with CSS, it looks fantastic to me.

The only problem is – as you can see – I am blogging on WordPress, but not a static site, and this increase the cost of publishing new note to my blog. Copy and paste each note and manually adjust for code blocks? This will definitely put me off from either taking notes or publishing them.

2. Use org2blog to publish Org-mode notes to WordPress

Gladly, we have org2blog to publish Org-mode notes to WordPress! It is pretty easy and straight forward to use org2blog!

2.1. Setup org2blog

First, install it:


And setup blog connection:


I also setup org2blog/wp-show-post-in-browser to show, so that each time I update the note to WordPress it will open up the post in browser for me.

2.2. Login to your WordPress

Use M-x org2blog-user-interface to open the org2blog main menu, then press 4 to enter password in minibuffer to login.

2.3. Upload note as a draft

Open up the main menu, and press j (Save Post Draft).

Done! It should now open up a browser and show you the draft in the tab.

3. Tricks and Hacks for org2blog

3.1. Export settings for headline section numbers (and TOC, TODO…etc)

I want section numbers in my notes, just like what Org-mode export has, but org2blog default to disable section numbers. We can use OPIONTS keyword to control export settings.

For example, if I want to have section numbers in my notes, then I can have the following keyword in my note:


If I want multiple options, use space to separate them:


3.2. Make org2blog properties insert after Org-roam

When publishing new draft or post, org2blog will insert their properties at the top of the file, this makes Org-roam feels bad (Org-roam‘s :PROPERTIES: should be at the top of the file).

We can apply the following patch to make org2blog insert their properties after Org-roam properties:


3.3. Make org2blog to use filetags as TAGS

Apply the following patch, so org2blog will use #+filetags as #+TAGS for the WordPress post tags.



Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.