Tagger extension allows organizing site content based upon
tags meta-data in paginated collections.
Given the configuration of:
extension Awestruct::Extensions::Tagger.new( :posts, '/index', '/blog/tags', :per_page=>10 )
The extension will scan
site.posts for every item with a
For each observed tag, a structure is created with the following behaviour
These structures will be sorted by popularity, trimmed to the top 100 tags,
and placed into
site.posts_tags as an ordered array. This array
||The seen tag|
||First page in this tag's index collection|
||All pages with the tag|
||Which group is this tag in terms of popularity|
From this analysis, the extension will create a paginated index for
each of the top 100 tags. The
input_path page denotes which page should
be used to iterate the tag's page collection.
page.posts collection, in this case, will hold the page's worth
of posts with a given tag.
The indexes will be output under the
The pages listing all posts of 1 specific tag (so filtering out other posts), have a
page.selected_tag variable with the name of the tag, which is usefull to adjust the page title accordingly.
To draw a full tag-cloud, the TagCloud extension should be used.
Awestruct::Extensions::Tagger.new(collection_name, input_path, output_prefix, opts)
||The name of the property on `site` to act as a source of tagged pages, typically an array.|
||Path to page to enumerate tagged items.|
||Path prefix to emit the resulting tagged pages|
||Additional options hash (see below). Also passed to an internal `Paginator`|
Awestruct::Extensions::Pipeline.new do extension Awestruct::Extensions::Tagger.new(collection_name, input_path, output_prefix, opts) end
Awestruct::Extensions::Pipeline.new do extension Awestruct::Extensions::Tagger.new( :posts, '/index', '/blog/tags', :per_page=>10 ) end