Request: Add a submodule which generates a "sitemap index" of all current sitemaps at /sitemap_index.xml

Appears there was some discussion about sitemap indexes in the past...
#327273: Multilingual support
#371756: <lastmod> tag doesn't get generate for all the site map chunks
...assume the use-case is mostly for multilingual sites, but there are certainly other reasons with the agnostic way multiple maps can be created.

Bonus request would be the ability to add a custom URL to the sitemap index list (for additional hard coded maps).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Anonymous’s picture

Status: Active » Postponed (maintainer needs more info)

This module already creates a sitemap index named sitemap.xml depending on the number of links the site has. I'm not sure what benefit another module would be because a sitemap index should not contain a link to another sitemap index. I'm inclined to mark this as "won't fix" but I'll give you a chance to state your case further.

doublejosh’s picture

Just misunderstood meaning. Referring to a "sitemap index" not a sitemap (as an index).

<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
   <sitemap>
      <loc>http://www.example.com/sitemap1.xml.gz</loc>
      <lastmod>2004-10-01T18:23:17+00:00</lastmod>
   </sitemap>
   <sitemap>
      <loc>http://www.example.com/sitemap2.xml.gz</loc>
      <lastmod>2005-01-01</lastmod>
   </sitemap>
</sitemapindex>

More details here: http://www.sitemaps.org/protocol.html#index

In my case I've used xmlsitemap_i18n to separate on language context, then need a sitemap index to refer to those sitemaps. Can certainly hardcode it, but would be a nice addition and would be nice to include the optional <lastmod> date as a dynamic entry.

malc0mn’s picture

Just to second doublejosh the functionality as described in http://www.sitemaps.org/protocol.html#index is really needed when using xmlsitemap_i18n

IMHO the http://yoursite.com/sitemap.xml should be a 'sitemap index' pointing to all the sitemaps defined in admin/config/search/xmlsitemap when using multiple sitemaps.

Anonymous’s picture

Sitemap indexes are used in xmlsitemap when more than one chunk file is created. I would like for Dave Reid to respond to this. We would need to include all sitemap index created by the user in our use of sitemap index. The file will still be named sitemap.xml and not sitemap_index.xml (the sitemaps.org reference is an example only).

doublejosh’s picture

Ahhh, I was unsure about the filename convention.

Separate/related issue...
Believe this index may be a need beyond language, but actually just found some Google documenation saying NOT to use multiple sitemaps.

#1670086: using rel="alternate" rather than multiple sitemaps by language context

mithenks’s picture

If for some reason anyone need this,
here is attached a possible implementation.

Regards,