Ticket #1880 (new enhancement)
Support for Google Sitemaps
| Reported by: | Martijn Pieters <mj@…> | Owned by: | jonas |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.0 |
| Component: | general | Version: | devel |
| Severity: | normal | Keywords: | |
| Cc: | ufs@…, werdlerk@… |
Description
Google can index websites more efficiently and more frequently when a site provides information about the site in the form of a Google Sitemap; a centralized description of site content including information about change frequency and last update time.
Trac already has such information at the ready; all it needs to provide is the XML file itself and perhaps offer a few other niceties such as a sitemap index and automatic resubmission when pages change.
Trac could be extended to provide the following features:
Sitemap
http://www.google.com/webmasters/sitemaps/docs/en/protocol.html
The sitemap lists every wiki page, roadmap milestone, changeset and ticket, with last-modification date. Perhaps the homepage of a trac project can be marked with a higher priority, and changesets can be marked with a changefreq tag set to 'never', while the timeline could marked as changing 'always'.
The spec leaves it open an what URL to present the map; it needs to be registered explicitly with Google the first time. However, it may be that in the future the file will be autodiscovered much like robots.txt is; by trying the /sitemap.gz URL. As such Trac should probably offer the sitemap under that URL; gzipping the generated content is easy enough.
Sitemaps Index
http://www.google.com/webmasters/sitemaps/docs/en/protocol.html#sitemapLocation
In a multiproject configuration using TracModPython the ModPythonHandler could provide for a /sitemaps.gz URL that lists the sitemaps for all the Trac projects it knows about using a sitemapindex document.
Automatic resubmission
http://www.google.com/webmasters/sitemaps/docs/en/submit.html#ping
Google allows for automatic notification of changes to sitemaps using a very simple HTTP GET API. Trac could automatically call this API whenever it learns of a change (wiki edits, ticket activity, etc.). This should be configurable, defaulting to 'off' as sitemaps have to be registered explicitly first (although there is no penalty for calling the API without having registered).


