Easy WP2.2 Slugs with TextMate

Note: This post is over a year old. You may want to check later in this blog to see if there is new information.

Here’s a quick tip for making use of the Wordpress 2.2 xmlrpc slug capabilities with TextMate

In your blogging bundle’s support library, in:

~/Library/Application Support/TextMate/bundles/Blogging.tmbundle/lib/blogging.rb

Just add the line:

@post['wp_slug'] = @headers['slug'] if @headers['slug']	

around line 278, after the keywords header line. Now you can add a “Slug:” line to your headers to define the post slug (the name used for the post in the permalink). You’ll want to add “[Ss]lug” to the list of header values in the language definition file for your preferred markup in the Blogging Bundle so that the header is properly highlighted, but that’s really all that’s necessary to make slugs work in TextMate with Wordpress 2.2.

There are quite a few changes in the xmlrpc, some documented better than others, so if I turn up more tricks I’ll be sure to share them.

» » » » » » »
  1. Alissa Miller 06.15.07 / 3pm

    Hey thanks for the great tip. It works like a charm.

    My blogging.rb file was actually located here:

    /Applications/TextMate.app/Contents/SharedSupport/Bundles/Blogging.tmbundle/Support/lib/blogging.rb

    I’m not really sure why mine is different. Other than that, no problems.

  2. Ankur 07.11.07 / 11pm

    Thanks for the tip. I’ve got it working, but my blogging.rb file was also inside TextMate.app.

Have your say

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>




Safari hates me