lib/nanoc/helpers/xml_sitemap.rb in nanoc-3.8.0 vs lib/nanoc/helpers/xml_sitemap.rb in nanoc-4.0.0a1
- old
+ new
@@ -47,11 +47,11 @@
# Create builder
buffer = ''
xml = Builder::XmlMarkup.new(target: buffer, indent: 2)
# Check for required attributes
- if @site.config[:base_url].nil?
+ if @config[:base_url].nil?
raise RuntimeError.new('The Nanoc::Helpers::XMLSitemap helper requires the site configuration to specify the base URL for the site.')
end
# Build sitemap
xml.instruct!
@@ -60,11 +60,11 @@
items.sort_by(&:identifier).each do |item|
reps = item.reps.reject { |r| r.raw_path.nil? }
reps.reject! { |r| !select_proc[r] } if select_proc
reps.sort_by { |r| r.name.to_s }.each do |rep|
xml.url do
- xml.loc @site.config[:base_url] + rep.path
- xml.lastmod item[:mtime].to_iso8601_date unless item[:mtime].nil?
+ xml.loc @config[:base_url] + rep.path
+ xml.lastmod item[:mtime].__nanoc_to_iso8601_date unless item[:mtime].nil?
xml.changefreq item[:changefreq] unless item[:changefreq].nil?
xml.priority item[:priority] unless item[:priority].nil?
end
end
end