Object
Generates a sitemap. The sitemap contains the hierarchy of all pages on the web site.
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
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
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.