Recently I’ve discovered Org2blog, an Emacs mode to write your blog posts locally using org-mode post them to your WordPress blog in a very fast and easy way.
The problem I found with this method is that it uses message-mode as its base mode. So you’re basically writing an email. The shortcomings of it were that whenever I wanted to write links, bold text, or any custom formatting generally done through HTML tags, I had to either type out the HTML or temporarily switch to html-mode. That sometimes gave me some problems converting the HTML code into entities, and ended up with a mess to fix at the WordPress editing textarea.
Org-mode (included in Emacs since about version 22.1), if you haven’t heard about it already, is a very good way to take notes, organize your tasks, among other day to day useful things. You also get some basic formatting like bold text and italics, as well as links among many other useful things. Nowadays, I find myself typing things in org files constantly throughout my day, and with all its long list of qualities, it became a more suitable way for me to write blog posts.
Org2blog provides a way to post your Org files or post a subsection of your file with a few keystrokes. All you need to do is clone the repository on your load path directory
git clone http://github.com/punchagan/org2blog.git
Then, add this to your .emacs file
(setq load-path (cons "~/.emacs.d/org2blog/" load-path)) (require 'org2blog-autoloads)
Finally set up you blog(s) settings in you .emacs file
(setq org2blog/wp-blog-alist '(("wordpress" :url "http://username.wordpress.com/xmlrpc.php" :username "username" :default-title "Hello World" :default-categories ("org2blog" "emacs") :tags-as-categories nil) ("my-blog" :url "http://username.server.com/xmlrpc.php" :username "admin")))
To start wrigint a new post, you can now use
Or, as I more frequently use, post a subtree of an existing org file using:
I hope you enjoy writing and posting your blog posts within Emacs and Org-mode. I certainly do and has turned out to be a very fast way to quickly draft and later on (even offline) elaborate on the blog post details in a comfortable editing environment. Also you get the added benefit of having a local copy (backup) of your blog posts as Org files.