Object
Source handler for creating an XML sitemap based on the specification of sitemaps.org.
Uses Webgen::Common::Sitemap to generate the needed sitemap tree and to check if a sitemap has changed.
Return the alcns of the sitemap node as a flat list.
# File lib/webgen/sourcehandler/sitemap.rb, line 43
43: def alcns(node)
44: website.blackboard.invoke(:create_sitemap, node, node.lang, options_for_node(node)).to_lcn_list.flatten
45: end
Return the rendered feed represented by node.
# File lib/webgen/sourcehandler/sitemap.rb, line 32
32: def content(node)
33: if node.node_info[:sitemap].blocks.has_key?('template')
34: node.node_info[:sitemap].blocks['template'].render(Webgen::Context.new(:chain => [node])).content
35: else
36: chain = [node.resolve("/templates/sitemap.template"), node]
37: node.node_info[:used_nodes] << chain.first.alcn
38: chain.first.node_info[:page].blocks['content'].render(Webgen::Context.new(:chain => chain)).content
39: end
40: end
Create an XML sitemap from path.
# File lib/webgen/sourcehandler/sitemap.rb, line 18
18: def create_node(path)
19: page = page_from_path(path)
20: path.ext = 'xml'
21: if path.meta_info['site_url'].nil?
22: raise Webgen::NodeCreationError.new("Needed information site_url is missing",
23: self.class.name, path)
24: end
25:
26: super(path) do |node|
27: node.node_info[:sitemap] = page
28: end
29: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.