Related links metadata

One of the new plugins I've added in the new version of Daizu, called RelatedLinks, allows you to add metadata about other web pages relating to an article. It displays them in a box in the right hand column.

This is really a bit of a hack, but it might get turned in to something more useful in the future. Below is some discussion of how it works and perhaps how it should work.

This article has two related links as an example. You can see them in the right hand column. You'll only see them on the actual web page because they aren't currently included in feeds. For an Atom feed they should probably be included as extra link elements with the appropriate rel value. It might also be worth including them at the bottom of the content in full content feeds, since I don't know of any aggregators that display links which only appear as metadata.

Related links metadata

You can identify which URLs should count as related links by listing them in the daizu:links property of the article file. This only provides the URLs. To display them properly more information is needed about them. Since you might want to use the same link more than once I thought it might be a good idea to factor this information out. Currently it is stored in some text files in the content repository.

A file called _hide/links.txt has an entry for each URL, which can look something like this:

bbc-news  http://news.bbc.co.uk/blah.html  Article Title

This gives the title of the page we're linking to. The first value is the name of the website the link comes from, which I'm calling the link source. It's just a short name you make up. That name is looked up in a separate file, called _hide/link-sources.txt. The corresponding entry in there would look like this:

bbc-news  http://news.bbc.co.uk/  BBC News

The ‘Related Links’ box displays both of these. I think having the name of the website gives useful context about what to expect from the link itself.

Now, storing these things in text files is only a temporary hack. I think it would be better to have them in the database, so that when Daizu gets a proper user interface you'll be able to edit them more easily. There would be some sort of interface for adding a related link to an article, either by picking one of the existing ones, or adding the information about a new link as you go. In some cases the UI might be able to fill in the titles for you (by getting them from the database if the link is to another page published by the same Daizu instance, or perhaps by getting the web page you want to link to and extracting its title).

Naming

Is the name ‘related links’ the right one for this feature? I'm not entirely sure. There may well be other ways of relating URLs to an article in the future, for example by saying that one article in Daizu is related to another which is also in Daizu. We might want that to appear distinct, with this feature providing only links to external websites. Certainly some sites already point out that such links are to external websites so that they can disclaim responsibility for them.

The property name should probably also change, perhaps to daizu:related-links (because there might be other more generic linking features in the future). Or maybe I should use the Dublin code element ‘relation’, by calling this something like dc:relation.

< Daizu CMS version 0.3 | Considering Git as a replacement for Subversion >