I’ve made some changes to the back end of the link farm. The original setup was that my comments on the link were buried away within the title tag and it occurred to me that when I scroll through other linklogs of this ilk I seldom bother to hover. However, the way the linkfarm is displayed on the sidebar of the main page dictates that they have to be hidden away. At the same time I wanted to make the RSS feed tidier. The obvious solution was to split up the three elements of the link and then stitch them back together depending on how the link is displayed.
The basic layout of a link, as it appears on the main blog page, looks like this:
<a href="URL" title="COMMENT">ANCHOR</a>
These three elements are entered into Movable Type using three separate fields. The Anchor goes in Entry Body, the URL is Extended Entry and the Comment in Keywords. (Which goes where doesn’t really matter but I chose to put the Anchor in Entry Body because it meant my archives, where the whole link was put in Entry Body, would still display reasonably well. It doesn’t produce good HTML but it works and I’d rather not bother editing all 238 entries by hand.)
For the link farm main index and monthly archives I wanted to have the comment follow the link so i changed the code in those templates to look like this:
<a href="<$MTEntryMore$>"><$MTEntryBody$></a>: <$MTEntryKeywords$>
To bring the links over to the main page I had been using the MTRSSFeed plug in. This rather neat plugin is is how I bring in other external blog stuff to the site such as my posts from BugPowder, though my use of it for the link farm was a bit unnecessary. It also turned out that rebuilding the link using the feed was not as simple as I might have thought, so I looked for a better solution using modules.
First I created a new template within the link farm with this code:
Last harvested on <$MTDate format="%B %e"$><br /> <MTEntries lastn="15"> <a href="<$MTEntryMore$>" title="<$MTEntryKeywords$>"><$MTEntryBody$></a><br /> </MTEntries>
This produces a very simple page which I called blogfeed.template. Then within the main blog setup I created a new module called linkfarm which linked to and synchronised with blogfeed.template. Then within the main page’s template I included this module using the code <$MTInclude module="linkfarm"$>. Now whenever the main page is updated it’ll suck in the link farm template displaying the most recent links.
The RSS feed is now free from internal use on my site and can be prepared for external use. What I wanted was for the feed to just display the link and nothing else. The standard implementation of RSS on Movable Type is obviously blog driven and serves to link back to the actual blog post. With a link log this isn’t necessary as there’s no need to visit the blog itself. The relevant part of the original RSS template looks like this:
<MTEntries lastn="15"> <item rdf:about="<$MTEntryPermalink encode_xml="1"$>"> <title><$MTEntryTitle encode_xml="1"$></title> <link><$MTEntryPermalink encode_xml="1"$></link> <description><$MTEntryExcerpt encode_xml="1"$></description> <dc:subject><$MTEntryCategory encode_xml="1"$></dc:subject> <dc:creator><$MTEntryAuthor encode_xml="1"$></dc:creator> <dc:date><$MTEntryDate format="%Y-%m-%dT%H:%M:%S" language="en"$><$MTBlogTimezone$></dc:date> </item> </MTEntries>
and I changed it to this:
<MTEntries lastn="15"> <item rdf:about="<$MTEntryMore encode_xml="1"$>"> <title><$MTEntryBody encode_xml="1"$></title> <link><$MTEntryMore encode_xml="1"$></link> <description><$MTEntryKeywords encode_xml="1"$></description> <dc:date><$MTEntryDate format="%Y-%m-%dT%H:%M:%S" language="en"$><$MTBlogTimezone$></dc:date> </item> </MTEntries>
In short, this means that Bloglines (and, one would hope, other RSS aggregators) displays the link as the main title of the “post” with my comment as the body and doesn’t link back to the farm.
The link farm can now be displayed in all manner of ways within my system while feeding out in a useful manner.