Sha256: ab194f1c478748241799e96054e41f61e2463748602fa15387a8ded6f57a2533
Contents?: true
Size: 1.05 KB
Versions: 1
Compression:
Stored size: 1.05 KB
Contents
module SitemapGenerator module Builder class SitemapIndexFile < SitemapFile def initialize(*args) super(*args) @xml_content = '' # XML urlset content @xml_wrapper_start = <<-HTML <?xml version="1.0" encoding="UTF-8"?> <sitemapindex xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/siteindex.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" > HTML @xml_wrapper_start.gsub!(/\s+/, ' ').gsub!(/ *> */, '>') @xml_wrapper_end = %q[</sitemapindex>] self.filesize = @xml_wrapper_start.bytesize + @xml_wrapper_end.bytesize end # Return XML as a String def build_xml(builder, link) builder.sitemap do builder.loc link[:loc] builder.lastmod w3c_date(link[:lastmod]) if link[:lastmod] end builder << '' end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
sitemap_generator-0.3.1 | lib/sitemap_generator/builder/sitemap_index_file.rb |