Parent

Included Modules

Class Index [+]

Quicksearch

Webgen::Tag::Sitemap

Generates a sitemap. The sitemap contains the hierarchy of all pages on the web site.

Public Instance Methods

call(tag, body, context) click to toggle source

Create the sitemap.

    # File lib/webgen/tag/sitemap.rb, line 12
12:     def call(tag, body, context)
13:       tree = website.blackboard.invoke(:create_sitemap, context.dest_node, context.content_node.lang, @params)
14:       (tree.children.empty? ? '' : output_sitemap(tree, context))
15:     end

Private Instance Methods

output_sitemap(tree, context) click to toggle source

Create the HTML representation of the sitemap nodes in tree in respect to context.

    # File lib/webgen/tag/sitemap.rb, line 27
27:     def output_sitemap(tree, context)
28:       out = "<ul>"
29:       tree.children.each do |child|
30:         sub = (child.children.length > 0 ? output_sitemap(child, context) : '')
31:         out << "<li>" + context.dest_node.link_to(child.node, :lang => child.node.lang || context.content_node.lang)
32:         out << sub
33:         out << "</li>"
34:       end
35:       out << "</ul>"
36:       out
37:     end
tag_config_base() click to toggle source

The modified tag base to support the easy specification of common.sitemap.* options.

    # File lib/webgen/tag/sitemap.rb, line 22
22:     def tag_config_base
23:       'common.sitemap'
24:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.