Class: Webgen::Common::Sitemap
- Inherits:
-
Object
- Object
- Webgen::Common::Sitemap
- Includes:
- WebsiteAccess
- Defined in:
- lib/webgen/common/sitemap.rb
Overview
This class provides functionality for creating sitemaps and checking if a sitemap has changed.
Instance Method Summary collapse
-
#create_sitemap(node, lang, options) ⇒ Object
Return the sitemap tree as Webgen::Tag::Menu::MenuNode created for the
node
in the languagelang
using the providedoptions
which can be any configuration option starting withcommon.sitemap
. -
#initialize ⇒ Sitemap
constructor
:nodoc:.
Methods included from WebsiteAccess
Constructor Details
#initialize ⇒ Sitemap
:nodoc:
13 14 15 |
# File 'lib/webgen/common/sitemap.rb', line 13 def initialize #:nodoc: website.blackboard.add_listener(:node_changed?, method(:node_changed?)) end |
Instance Method Details
#create_sitemap(node, lang, options) ⇒ Object
Return the sitemap tree as Webgen::Tag::Menu::MenuNode created for the node
in the language lang
using the provided options
which can be any configuration option starting with common.sitemap
.
20 21 22 23 24 25 26 |
# File 'lib/webgen/common/sitemap.rb', line 20 def create_sitemap(node, lang, ) @options = tree = recursive_create(nil, node.tree.root, lang).sort! @options = nil (node.node_info[:common_sitemap] ||= {})[[.to_a.sort, lang]] = tree.to_lcn_list tree end |