Hi everybody,
I''m currently investigating how to implement tags support so that it
fits the need of most users.
What I''m thinking about so far:
* Tags are specified via the `tags` meta information key, like this:
---
title: Some blog article
tags: [webgen, ruby, css]
---
Body of the article
* The SourceHandler::Tag uses a file with the extension .tag and has a
content similar to that of the SourceHandler::Feed. For example,
consider the file /blog/blog.tag
name: myblog # overwrite the unique identifier
# (was blog before, from the
# filename)
entries: article/**/*.html # pattern for the pages to use
create_feeds: true # create a feed for each tag
entries_per_page: 20 # number of entries per tag page
# creates more than one page if
# necessary
directory: tag # the directory in which the tag
# pages should be created
template: tag.template # the template that should be used
# to render the tag pages
From this file the source handler creates the following files:
/blog/tag/tagname.page
/blog/tag/tagname.feed
/blog/tag/othertag.page
/blog/tag/othertag2.page
/blog/tag/othertag.feed
The created tag pages do not contain any content, only meta
information and the information to which .tag path they belong and
which tag they represent. The rendering of a tag page is done via a
template, in the case above via /blog/tag.template. A default tag
template will be shipped with webgen.
The tag pages can be localized to a specific language by providing
the language in the file name, for example blog.de.tag. However, you
have to ensure that you use the correct pattern for the `entries`
option!
* There will be some webgen tags to handle the displaying of tags in
pages. The only one I can currently think of is a tag cloud.
The above is my current plan. However, before I''m going to implement
this I kinda like to have some feedback on the following questsion:
* The above scheme handles flat tag spaces which is the most common use
case, I think. I have searched a bit for nested tag implementation but
did not find anything useful. Are nested tags useful? How should they
be implemented? Are there any example implementations in other programs
you can refer me to?
* The `entries` key is still to unflexible. As I have said before I
will implement a more flexible solution which will allow the following:
- filter nodes by LCN patterns
- filter nodes by properties
- sort by a node property
- limit the returned nodes (all, range, first n)
and probably some others. Are there any other filters/options you want
to have when selecting nodes for a feed, a tag file, a blog file, ...?
* Are there any other options for the tag source handler you need
except those listed above (name, entries, create_feeds, ...)?
* Are there any other webgen tags you can think of that would be useful
for the general public?
I have planned to start implementing the tag source handler after the
0.5.6 release this weekend. So there is some time to answer my
questions :)
Thanks,
Thomas