How to easily generate a XML-sitemap in Jekyll without any plugins.
Generating a dynamically updated sitemap according to sitemaps.org protocol in Jekyll extremely easy without any plugins.
All of the credits go to Daviden Singer exellent post on building a better sitemap with Jekyll, which is 95% copied below. I just made a small tweak, changing unless post.published == false to unless post.published == false or post.sitemap.exclude == "yes" so also post can be excluded.
1. Create a XML-file
Create a new file with the XML-extension into root folder called sitemap.xml.
2. Generate XML-sitemap
Simply add the following code:
3. Add Front Matter to posts/pages (Optinal)
Now we can add the following optional Front Matter markup to posts and pages
Per default all post and pages will get changefreq monthly, pages gets priority 0.5 while posts get 0.3.