Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
blog from org-mode to wordpress
Emacs Lisp
branch: experimental

This branch is 223 commits behind punchagan:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
README.org
metaweblog.el
org2blog.el

README.org

Org2blog Readme

Overview

org2blog is a tool to publish directly from Emacs’ org-mode to WordPress blogs.

It is inspired by and based on a wordpress posting client for muse-mode written by Ashish Shukla.

org2blog is licensed under GPLv3

Installation

Download org2blog from github

git clone http://github.com/punchagan/org2blog.git

Add the org2blog directory to your load path and then add

(setq load-path (cons "~/.emacs.d/org2blog/" load-path))
(require 'org2blog)

to your dot emacs.

Dependencies

  1. org2blog depends on xml-rpc available at Launchpad. Add it to your load-path before using org2blog.
  2. Make sure you have the latest org-mode installed. org2blog may not work with older versions of org.

Usage

Defining your blog setup

You can (should) tell org2blog where your blogs are and optionally specify different values for some options. This is done by customising the variable org2blog-blog-alist.

For example:

(setq org2blog-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")))

This defines two blogs identified by the terms wordpress and my-blog.

The variables in the plist set for each blog over-ride the global values of the corresponding variables. url and username are mandatory variables. Others are optional. If you customize the variable org2blog-blog-alist there is detail information about the meaning of each property.

If you use only categories, set the org2blog-use-tags-as-categories variable.

(setq org2blog-use-tags-as-categories t)

If you wish to be asked for confirmation before publishing a post, set the variable org2blog-confirm-post.

To browse or customize other variables use the customize group function.

M-x customize-group org2blog RET

Logging In

Use M-x org2blog-login. This function ask you for the name of one of the blogs you have configured in the org2blog-blog-alist variable described above and will ask for your password. The counterpart of this function is M-x org2blog-logout, which will log you out of the active blog.

Writing a new post

Use M-x org2blog-new-entry.

  • Tags and Categories are comma or space separated values. Completion (for both) is triggered using C-c t. If a new category is used you will be prompted before adding it.
  • The excerpt for a post can be written as #+DESCRIPTION.
  • The parent for a page can be specified using #+PARENT.\ C-c t again provides completion for the page name.

Publishing

post buffer as draft C-c d M-x org2blog-post-buffer
publish buffer C-c p C-u M-x org2blog-post-buffer
post buffer as page draft C-c D M-x org2blog-post-buffer-as-page
publish buffer as page C-c P C-u M-x org2blog-post-buffer-as-page

Post your existing org-files too

  • Add #+TITLE, #+OPTIONS, #+TAGS, #+CATEGORY, #+DESCRIPTION, #+DATE, to your file. (All of these are Optional)
  • Add a #+POSTID to edit an existing post.
  • Post buffer using the function names, as above.

Posting a subtree

  • Use M-x org2blog-post-subtree.
  • Tags of the subtree will be used for tags. Other properties can be set using a property drawer.

Delete an entry or a page

  • If you are in the buffer of the entry/page, with #+POSTID present on the page, use :
    M-x org2blog-delete-entry or M-x org2blog-delete-page
  • If you want to delete a particular post (whose post-id is known) from any buffer, use
    C-u post-id M-x org2blog-delete-entry.

Similarly, for a page.

Enabling org2blog mode (defines key-bindings)

  • use M-x org2blog-mode. This defines the following the key-bindings:
    C-c p publish buffer
    C-c d post as draft
    C-c t complete tag or parent page name

Uploading Images

In-line images and linked images with file:// urls (e.g., [[file:///path.to.jpeg]] or [[file:///path.to.jpeg][this is an image link]] will be uploaded to the media library and the links will be updated. Captions and attributes as defined in org-mode will be preserved, but at present these attributes are not saved with the image to the library itself. [Information about uploaded files are added as a comment to the post itself, to prevent repeated uploads, but this isn’t as stable as I would like it.]

Miscellaneous

  1. You may want to look at the Export options and HTML export sections of the org-manual.
  2. If you wish to post to blogger from org-mode, look at -
  3. If you have an issue/bug/feature request, use the issue tracker on git or drop a mail to punchagan+org2blog[at]gmail[dot]com.
  4. If you haven’t found a bug/issue, but have tried out and/or are using org2blog to post to your blog, post me a line on how you use it and on what blog. I’d love to hear from you!
Something went wrong with that request. Please try again.