Horrell.ca

A Ghost blog (not a blog about ghosts).

Switching over from Textpattern to Ghost

I recently switched Horrell.ca from Textpattern to Ghost. Chances are there are a bunch of broken links to files and such. I'm still tweaking and fixing things and reworking the site design, so expect more changes in the coming months :)

For anyone else who wants to attempt this, a word of warning: there's no easy way to export content from Textpattern to import into Ghost. Ideally, a Textpattern plugin for this would help tremendously, but I wasn't able to find one. I was going to attempt to create one myself, but it's been so long since I've worked in PHP or created a Textpattern plugin that it didn't seem to be worth my time. Instead I (mostly) followed the instructions I found here. The short version of what you have to do: you need to temporarily setup a WordPress blog, import your Textpattern posts into that, then export your posts via a Ghost WordPress plugin, then import into Ghost. Yeah. If you use Textpattern and are thinking about moving to Ghost, it might be best to wait for a bit until bettor options come up.

Despite all that, at least for me, the switch has been worthwhile. It's a great platform for writting and since it runs on Node.js, it's very light on resources. I was able to resize my current Joyent SmartOS instance down significantly since removing Apache and MySQL from the equation.

Speaking of SmartOS instances, I created a handy script for getting Ghost up and running on Joyent called smarty-ghost . It works fairly well and takes care of setting up the SMF manifest for you. I'll be improving that script over time and the install process should become much simpler when Ghost becomes an published npm package.

Oh, and while I was moving things around on my site I put all the Textpattern plugins I created over the years on GitHub. I probably won't be using Textpattern much or contributiing to the ecosystem anymore, but my old code is out there for anyone who might find it usefull. Here's a list of links to each plugin repo:

In which I present my 3rd and 4th Textpattern Plugins

Introducing my third and fourth Textpattern plugins:

They’re pretty much a matched set and compliment cwhlinktohome in functionality. These ones took a little longer to produce than cwhlinktohome, partly because I was stumped for a bit as to how to maintain the functionality of the tags they replace, but also due to a healthy bought of procrastination. Fantastic method to problem solving that, especially when there’s no deadline looming.

cwh_link_to_prev

cwh_link_to_prev is a Textpattern plugin that provides a replacement tag for <txp:link_to_prev /> that includes a new format attribute which provides the ability to set the link format as a link tag suitable for placing in the head of any individual article page on your site. You can do this by setting the format attribute like so:

<txp:cwh_link_to_prev title="Previous" format="link" />  

which will produce something similar to:

<link rel="prev" href="http://example.com/article/1/previous-post" title="Previous Post" />  

Note that when used as a single tag without the format attribute specified:

<txp:cwh_link_to_prev />  

it will produce a plain text link much in the same way as <txp:link_to_prev />:

http://example.com/article/1/previous-post  

Finally, it can also be used as a container tag in the same manner as <txp:link_to_prev /> if no format value is specified:

<txp:cwh_link_to_prev> ...Text or Tag... </txp:cwh_link_to_prev>  

If you do specify a link value for the format attribute while used as a container tag, it will still produce a link tag.

This tag also shares all of the same attributes as <txp:link_to_prev />. For a complete list of applicable attributes, see this Textbook entry.

For a further explanation of the benefits of using link tags for your site's navigation, please see Day 9: Providing additional navigation aidsfrom Mark Pilgrim's Dive Into Accessibility.

You can download the plugin below:

cwh_link_to_prev

cwh_link_to_next

cwh_link_to_next is a Textpattern plugin that provides a replacement tag for <txp:link_to_next /> that includes a new format attribute which provides the ability to set the link format as a link tag suitable for placing in the head of any individual article page on your site. You can do this by setting the format attribute like so:

<txp:cwh_link_to_next title="Next" format="link" />  

which will produce something similar to:

<link rel="next" href="http://example.com/article/2/next-post" title="Next Post" />  

Note that when used as a single tag without the format attribute specified:

<txp:cwh_link_to_next />  

if will produce a plain text link much in the same way as <txp:link_to_next />:

http://example.com/article/2/next-post  

Finally, it can also be used as a container tag in the same manner as <txp:link_to_next /> if no format value is specified:

<txp:cwh_link_to_next> ...Text or Tag... </txp:cwh_link_to_next>  

If you do specify a link value for the format attribute while used as a container tag, it will still produce a link tag.

This tag also shares all of the same attributes as <txp:link_to_next />. For a complete list of applicable attributes, see this Textbook entry.

For a further explanation of the benefits of using link tags for your site's navigation, please see Day 9: Providing additional navigation aids from Mark Pilgrim's Dive Into Accessibility.

You can download the plugin below:

cwh_link_to_next

In which I present my second Textpattern Plugin

Introducing my second Textpattern plugin cwh_link_to_home page. This one was way easier in that I didn't have to crosscheck 700 hobo names. It also has an accessibility bent to it, which I'm particularly proud of. You can read more about it and what it does on the cwh_link_to_home page.