Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
simple_sitemap
Commits
3f70f2d4
Commit
3f70f2d4
authored
Aug 23, 2016
by
Pawel G
Browse files
Add module metadata to generated sitemaps
parent
3fe8c17e
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/SitemapGenerator.php
View file @
3f70f2d4
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment