Commit 3f70f2d4 authored by gbyte.co's avatar gbyte.co

Add module metadata to generated sitemaps

parent 3fe8c17e
......@@ -13,6 +13,7 @@ class SitemapGenerator {
const ENCODING = 'UTF-8';
const XMLNS = 'http://www.sitemaps.org/schemas/sitemap/0.9';
const XMLNS_XHTML = 'http://www.w3.org/1999/xhtml';
const GENERATED_BY = 'Generated by the Simple XML sitemap Drupal module: https://drupal.org/project/simple_sitemap.';
private $generator;
private $db;
......@@ -137,6 +138,7 @@ class SitemapGenerator {
$writer->openMemory();
$writer->setIndent(TRUE);
$writer->startDocument(self::XML_VERSION, self::ENCODING);
$writer->writeComment(self::GENERATED_BY);
$writer->startElement('sitemapindex');
$writer->writeAttribute('xmlns', self::XMLNS);
......@@ -166,6 +168,7 @@ class SitemapGenerator {
$writer->openMemory();
$writer->setIndent(TRUE);
$writer->startDocument(self::XML_VERSION, self::ENCODING);
$writer->writeComment(self::GENERATED_BY);
$writer->startElement('urlset');
$writer->writeAttribute('xmlns', self::XMLNS);
$writer->writeAttribute('xmlns:xhtml', self::XMLNS_XHTML);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment