lib/jekyll-sitemap.rb in jekyll-sitemap-0.9.0 vs lib/jekyll-sitemap.rb in jekyll-sitemap-0.10.0
- old
+ new
@@ -21,13 +21,19 @@
@site.keep_files ||= []
@site.keep_files << "sitemap.xml"
end
end
+ HTML_EXTENSIONS = %W(
+ .html
+ .xhtml
+ .htm
+ )
+
# Array of all non-jekyll site files with an HTML extension
def html_files
- @site.static_files.select { |file| File.extname(file.relative_path) == ".html" }
+ @site.static_files.select { |file| HTML_EXTENSIONS.include? file.extname }
end
# Path to sitemap.xml template file
def source_path
File.expand_path "sitemap.xml", File.dirname(__FILE__)
@@ -50,11 +56,11 @@
def sitemap_content
site_map = PageWithoutAFile.new(@site, File.dirname(__FILE__), "", "sitemap.xml")
site_map.content = File.read(source_path)
site_map.data["layout"] = nil
- site_map.render(Hash.new, @site.site_payload)
- site_map.output.gsub(/\s*\n+/, "\n")
+ site_map.render({}, @site.site_payload)
+ site_map.output.gsub(/\s{2,}/, "\n")
end
# Checks if a sitemap already exists in the site source
def sitemap_exists?
if @site.respond_to?(:in_source_dir)