Google Sitemap Support

ludo, Friday 03 June 2005 13:14:52 PST

A couple of hours of free time before getting to work this morning have produced Google Sitemap support for LightPress, and a new 1.0.6 beta release. It's a beta since Sitemap support is not well tested, and I would like to add gz compression support before declaring it stable. Our Sitemap implementation has a few interesting features:

  • the "home" Sitemap lists URLs for all categories, archives, and the latest

    posts_per_rss

    posts

  • each category and each archive has its own Sitemap, listing itself and all its posts

  • a SiteIndex lists all the available Sitemap

  • the

    lastmod

    element is set to the date of the last post for categories and for the current month in archives, and for the last day of the month in old archives

  • Last-Modified/Etag support, since it shares our feed serving code

1.0.6b can be downloaded from the usual place, where you can also find its ChangeLog (also copied below). After having written this post, I noticed a couple of bugs in feed.php, which you can patch by applying this small patch to 1.0.6b if you do not want to wait for 1.0.6 final. [tag: ]

Update After modifying the root element in the templates according to Google Sitemap Help, both our sitemap and sitemap index validate.

2005-06-03 12:35  ludo

* classes/Frontend.php: bumped version number to 1.0.6b

2005-06-03 12:32  ludo

* templates/: kubrick/en_US.ISO-8859-1/sitemap.xml,
	  kubrick/en_US.ISO-8859-1/sitemap_index.xml,
	  kubrick/en_US.UTF-8/sitemap.xml,
	  kubrick/en_US.UTF-8/sitemap_index.xml,
	  default/en_US.ISO-8859-1/sitemap.xml,
	  default/en_US.ISO-8859-1/sitemap_index.xml,
	  default/en_US.UTF-8/sitemap.xml,
	  default/en_US.UTF-8/sitemap_index.xml: initial import

2005-06-03 12:30  ludo

* feed.php: fix last_modified for category feeds, move utility
	  functions to Frontend, add Google sitemap/siteindex support

2005-06-03 12:29  ludo

* .htaccess: add archives sitemaps

2005-06-03 12:26  ludo

* classes/Frontend.php: reorganize methods, add a few variables to
	  archive items

2005-06-03 12:25  ludo

* .htaccess: add sitemap and siteindex rules

Readers' Comments

  1. jerome

    Your productivity this week is impressive. I can barely find time to update my site but you've issued two new releases of LightPress plus merged in the dev branch and worked on the backend.

    Which means that when I *do* find some free time, I'll have my debugging work cut out for me! :)

  2. ludo

    Yes I was on a roll this week, and I was lucky to have a couple of days at home to work on LightPress.

    As you say the real problem is finding enough free time to get started with non-trivial things, then it's easy. :)

  3. Per

    The archive sitemap above return a RSS 2.0 feed, why ?

    In their FAQ they say: we prefer that you use the Google Sitemap format

    Just curious :-)

  4. ludo

    Yes, it's a bug in our mod_rewrite rules. Thanks for pointing it out. :)