Sitemap XML Extension
About
An XML Sitemap is used to give search engines information about your site. The Radiant SitemapXML Extension by Aissac creates a XML sitemap for your site.
Tested on Radiant 0.8 and 0.9 RC1.
Features
- Allows you to specify in Radiant admin which pages appear in the sitemap;
- Gives you the possibility to set the
change_frequencyandpriorityper page.
Installation
All you have to do is install the Radiant Sitemap XML Extension:
1 2 | git clone git://github.com/Aissac/radiant-sitemap-xml-extension.git\ vendor/extensions/sitemap_xml |
and run the migration
1 | rake radiant:extensions:sitemap_xml:migrate |
Note
The git branches hold stable versions of the extension for older version of Radiant CMS. To checkout one of these branches:
1 2 3 4 | git clone git://github.com/Aissac/radiant-sitemap-xml-extension.git\ vendor/extensions/sitemap_xml cd vendor/extensions/sitemap_xml git checkout -b <branch-name> origin/<remote-branch-name> |
Configuration
The <loc> XML tag holds the URL of the page. This URL must begin with the protocol (such as http) and end with a trailing slash. Radiant Sitemap extension automatically creates this tag for you, but you have the possibility to override it by setting Radiant::Config["sitemap_xml_domain"] to something like 'http://your-site.com'.
1 | Radiant::Config["sitemap_xml_domain"] = "http://your-site.com" |
Usage
You can set if a particular page will make it to the sitemap by checking or unchecking the Appear in sitemap checkbox on each page.
The Sitemap protocol format consists of XML tags:
-
The
<loc>required tag:- URL of the page. This URL must begin with the protocol (such as http) and end with a trailing slash.
- You can override the host name by setting the
Radiant::Config["sitemap_xml_domain"] = ‘http://your-site.com’ - Will be automatically created from the url of each page.
-
The
<lastmod>optional tag:- The date of last modification of the file. This date is in W3C Datetime format (YYYY-MM-DD).
- Will be automatically created from the
updated_atattribute of each page.
-
The
<changefreq>optional tag:- How frequently the page is likely to change.
- You can set the
changefreqfrom theChange frequencydrop down on each page.
-
The
<priority>optional tag:- The priority of this URL relative to other URLs on your site. The default priority of a page is 0.5.
- You can set the
priorityfrom thePrioritydrop down on each page.
-
Visit
http://yoursite.com/sitemap.xml
For more information on sitemaps, visit sitemaps.org.
Contributors
- Cristi Duma (@cristi_duma)
- Istvan Hoka (@ihoka)