wiki:GoogleSitemapPlugin

Version 12 (modified by Martin Scharrer, 14 years ago) (diff)

--

Google sitemap generator

Description

This plugin will handle requests of the URL /sitemap.xml and will produce XML suitable for submission to the Google sitemap service. The sitemap is a way to describe your site's content other than depending on a crawler that follows every link. It's suitable for dynamic sites with lots of different URLs for basically the same content.

The maintainer-ship of this plugin for Trac 0.11+ was taken over by martin_s in May 2010. The new Trac 0.11 version was written from scratch, mainly because of great API changes between the Trac versions. This wiki page is not yet fully updated to reflect the (sometimes missing) features of the new version.

The plugin will notify Google by sending a PING request to their site whenever content on your trac has changed (Trac 0.10 version only). For now, wiki pages are supported in the sitemap, but tickets will eventually follow.

Requirements

The plugin was tested with Python 2.4 but should work with 2.3 as well. It uses API extensions of trac 0.10, so it wouldn't run with older versions of trac. Furthermore, you need setuptools to install and run the extension.

If the webadmin plugin is installed, this plugin will register a page to configure it.

Installation

Download the source code into a directory of your choice, open a command line terminal and run this command:

python setup.py install

Activate the plugin in your trac environment by adding this line to the section [component] of trac.ini

sitemap.* = enabled

Restart your webserver.

Bugs/Feature Requests

See existing bugs and feature requests, and feel free to create a new ticket.

Download and Source

Trac 0.10
The project has been recently reactivated, since the original source code location has been switched off. In future, source will be on trac hacks SVN. Meanwhile, there's a trac.10 compatible egg available as an attachment here. Place it in the Trac plugins directory, e.g. /usr/share/trac/plugins. Visit http://svn.software-consultant.net/browser/sitemap-plugin/trunk to browse the source code.

Example

This is how a sitemap XML could look like:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.google.com/schemas/sitemap/0.84">
<url>
<loc>http://localhost/wiki/ImageTest</loc>
<lastmod>2006-11-07T15:37:07Z</lastmod>
<changefreq>daily</changefreq>
</url>
</urlset>

More about the document format can be found here.

Recent Changes

17141 by rjollos on 2018-04-16 20:45:09
TracGoogleSitemapPlugin 1.1: Conform to PEP8
15264 by rjollos on 2016-02-11 04:22:34
Remove unnecessary svn:mime-type on py files

svn:mime-type was set to "plain" for many files.

9514 by martin_s on 2010-11-24 20:42:18
tracgooglesitemap/plugin.py
Added missing else clause for _fixtime method. This should fix #8152.
(more)

Author/Contributors

Author: martin_s (Trac 0.11), datenimperator (Trac 0.10)
Contributors: