Sha256: 933b98ab511e15454c4eba9f7c477a2567e858cfd86faa3c1333c4709898c925
Contents?: true
Size: 674 Bytes
Versions: 7
Compression:
Stored size: 674 Bytes
Contents
module Awestruct module Extensions class TagCloud def initialize(tagged_items_property, output_path='tags', opts={}) @tagged_items_property = tagged_items_property @output_path = output_path @layout = opts[:layout].to_s @title = opts[:title] || 'Tags' end def execute(site) page = site.engine.load_page( File.join( File.dirname( __FILE__ ), 'tag_cloud.html.haml' ) ) page.output_path = File.join( @output_path ) page.layout = @layout page.title = @title page.tags = site.send( "#{@tagged_items_property}_tags" ) || [] site.pages << page end end end end
Version data entries
7 entries across 7 versions & 1 rubygems