Posted on 3rd January 2010No Responses
Posting to Wordpress from Textmate

A reminder of how to post to Wordpress using the Textmate Blogging bundle:

WorkFlow

Setup Blogs

I’m writing posts using Textmate, setup is fairly straightforward once you have configured the blog correctly. The first step is to configure the communication between Textmate and the blog. This is done using the Blogger bundle. Go to Bundles -> Blogger -> Setup Blogs, this will open a document named ‘com.macromates.textmate.blogging.txt’ that will look something like this:

# List of Blogs

#

# Enter a blog name followed by the endpoint URL

#

# Blog Name URL

# example http://username@mysite/myBlog/xmlrpc.php

# login: admin, pwd: xyxyxyxyxy

Obviously this should be completed with the relevant details from your server, taking care to construct the path correctly depending on wether you installed Wordpress in a sub-folder or not.

You can test that everything is set up ok by running Bundles -> Blogger -> FetchPost. Assuming you have a post on your blog you should get a selection dialogue containing a list of all the available posts.

Next, writing a blog post:

New Post

From the File menu in Textmate choose File -> New From Template -> Blogging -> Blog Post(html) – or any of the other format options depending on preference and need – I am using the html template because flash insists on well-formatted xml/xhtml in order to set the htmlText property on the textField.

After that it is just a matter of writing the post. I find Textmate to be just flexible enough to write reasonably quickly and with enough keyboard shortcuts to efficiently format the html without too much stress. My flash Newsreader is configured to style the text using CSS Stylesheets so I specify style classes as I write.

I usually test the post a number of times while I am writing (CMD, CTRL – P on the Mac). Myabe not ideal as it means the post goes live immediately, but as long as there isn’t anything embarrassing in there the likelihood of someone reading it before it’s complete are slim.

One little gotcha! When dragging an image onto your blog post in Textmate – cool feature – you have to remember to add a closing slash to produce well-formatted xhtml as Textmate doesn’t insert one.

Comments