Sitemaps Plugin

  • Tags : /
  • Latest : 0.2.0
  • Last Updated: 18 February 2014
  • Grails version : 2.0 > *
0 vote
Dependency :
compile ":sitemaps:0.2.0"

Documentation Source Issues


Creates a standard interface for building sitemaps via a common Sitemap Artefact.


plugins {
  compile ':sitemaps:0.1.0'


The grails sitemaps plugin provides a common interface for building out sitemaps. This supports generating sitemaps both in a single application environment as well as a plugin heavy environment. You can simply create Sitemap classes in the grails-app/sitemaps folder and your good to go.

To get started simply create a sitemap class in the grails-app/sitemaps folder with the following implementation:

This can be done using the grails create-sitemap generator.

class CmsSitemap {
  static sitemap = "cms"

List getSitemapUrls() { return [ [url: '', lastmod: new Date()], [url: '', lastmod: new Date(), priority: 0.1] [url: '', lastmod: new Date(), changefreq: 'weekly'] ] }

String getDefaultChangeFrequency() { return "monthly" }

Double getDefaultPriority() { return 1.0 } }

As long as the 3 methods above are defined, you are good to go. The sitemap static variable defines the url name to represent this particular sitemap. In the case of the example above, the sitemap would be viewable with the url: .

All sitemaps are combined into a single sitemap set via the /sitemap.xml url mapping.

This plugin also takes advantage of the grails cache plugin to cache your sitemaps. These sitemap caches can be evicted by using the sitemapService.evictCache() method.