An XML Sitemap can be useful for optimising your site with Google, particularly if you make use of their Webmaster Tools. Jekyll doesn’t come with one out-of-the-box, but it is easy to add one. There’s probably a plugin out there which will automate things, but I just used a normal Jekyll-generated file for mine, based on code found on Robert Birnie’s site.
The only modification I made was to exclude feed.xml from the sitemap. Because this is auto-generated by a plugin I couldn’t add any front-matter to a file to exclude it in the same way as other files.
Create a file called sitemap.xml in the root of your site, and paste the following code into it:
If you want fine-control over what appears in the sitemap, you can use any of the following front-matter variables.
Chris McLeod mentioned this article on mrkapowski.com.