Categories
Movable Type

Movable Type macros for Everything2

Back in the (good/bad…proabably bad) old days when the sunpig site was running on some scraps of PHP code I’d cobbled together myself, it had the ability to automatically convert Everything2 style hard links and pipe links. This meant that we could copy and paste content between here and E2 without doing any extra editing.

When we moved over to Movable Type, though, we lost that facility We gained much, much more in the process, though. But now that Movable Type has support for macros, thanks to the incredibly cool Brad Choate, I can put these E2 links back.

All that is required are two macros:


<MTMacroDefine name="e2hardlink" pattern="m/\[([^\|]*?)\]/">
<a href="http://www.everything2.com/?node=<MTNull encode_url="1"><MTMacroMatch position="1"></MTNull>" title="<MTMacroMatch position="1">"><MTMacroMatch position="1"></a></MTMacroDefine>

<MTMacroDefine name="e2pipelink" pattern="m/\[(.*?)\|(.*?)\]/">
<a href="http://www.everything2.com/?node=<MTNull encode_url="1"><MTMacroMatch position="1"></MTNull>" title="<MTMacroMatch position="2">"><MTMacroMatch position="2"></a></MTMacroDefine>

Nifty! But probably of more use to Abi, because I don’t tend to post on E2 these days.