11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# File 'lib/awestruct/extensions/sitemap.rb', line 11
def execute( site )
sitemap_pages = []
entries = site.pages
entries.each { |entry| sitemap_pages << set_sitemap_data( entry ) if valid_sitemap_entry( entry ) } if entries
site.sitemap.pages.each do |entry|
page = Awestruct::Page.new( site )
page.output_path = entry.url
page.date = entry.date( nil )
page.priority = entry.priority( nil )
page.change_frequency = entry.change_frequency( nil )
sitemap_pages << page
end if site.sitemap
site.engine.set_urls( sitemap_pages )
sitemap = File.join( File.dirname(__FILE__), 'sitemap.xml.haml' )
page = site.engine.load_page( sitemap )
page.output_path = 'sitemap.xml'
page.sitemap_entries = sitemap_pages
site.pages << page
end
|