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 11 def call(tag, body, context) tree = website.blackboard.invoke(:create_sitemap, context.dest_node, context.content_node.lang, @params) (tree.children.empty? ? '' : output_sitemap(tree, context)) end
Create the HTML representation of the sitemap nodes in tree in respect to context.
# File lib/webgen/tag/sitemap.rb, line 26 def output_sitemap(tree, context) out = "<ul>" tree.children.each do |child| sub = (child.children.length > 0 ? output_sitemap(child, context) : '') out << "<li>" + context.dest_node.link_to(child.node, :lang => child.node.lang || context.content_node.lang) out << sub out << "</li>" end out << "</ul>" out end
Generated with the Darkfish Rdoc Generator 2.