I already published an article about org2blog.
This is another one explaining how to install org2blog using simply a ~/.netrc
file.
For this, I developed a simple emacs-live pack called blog-pack.
pre-requisite
- emacs 24 installed
- emacs-live installed too.
- install-packages-pack installed too
install
clone
git clone git@github.com:ardumont/blog-pack.git
.emacs-live.el
Create the file ~/.emacs-live.el
and add this line inside:
;; adding the list of live packs (live-add-packs '("/path/to/blog-pack"))
This file is called by emacs-live's startup routine to load user packs after the emacs-live's standard ones.
setup
Now we need to setup the blog-pack with your credentials and some other setup regarding your wordpress installation.
For this, create a ~/.netrc
file.
touch ~/.netrc
credentials
Add your wordpress credentials in the ~/.netrc
file in a machine blog line:
machine blog login some-login password some-password
This is simply key-value pairs inlined in a file:
Entry | Description |
---|---|
machine | blog - A hard-coded line to blog to add informations regarding credentials |
login | Your wordpress login |
password | Your wordpress password |
Important: The machine blog pair is mandatory, otherwise, this won't work.
Example:
machine blog login tony password "(-> (and emacs emacs-live clojure haskell) rock hard)"
Note if your password contains spaces, quote the password with ".
description
Now we need to add some description about your blog. Add another line with the machine blog-description entry like this:
machine blog-description blog-name your-blog-name blog-url-rpc http://your-wordpress-blog-url/path/to/xmlrpc.php
This is again key-value pairs inlined in a file:
Entry | Description |
---|---|
machine | blog-description - A hard-coded line to blog-description to add informations about the blog's other setup. |
blog-name | The name of the blog used to discriminate between multiple blogs (if you use many) |
blog-url-rpc | The path to the xmlrpc.php page used to send your org-mode exported as html. The form is: http://your-wordpress-blog-url/path/to/xmlrpc |
Important: The machine blog-description pair is mandatory, otherwise, this won't work.
Example:
machine blog-description blog-name tony-blog blog-url-rpc http://tony-blog.fr/blog/xmlrpc.php
Ok, now you're all ready to go.
run
Start emacs. Open a org-mode file and write whatever you wish.
When ready to publish a draft, hit C-t d
.
When ready to publish, hit C-t p
.