Jekyll sitemaps

Jekyll sitemaps

This plugin extends Jekyll sitemaps and adds support for pages, posts, archives/categories, collections and images.

Before i switched to Jekyll I’ve been spoiled by the sitemaps of the Yoast SEO plugin. So I decided to try to get the same functionality from Jekyll. The goal was also to make it available for people who host their Jekyll sites on Github Pages.

Jekyll Sitemaps example

You can take a look at the sitemap for this site to see it in action.

Installation

  1. Start by downloading Jekyll Sitemaps from Github.
  2. Copy category-sitemap.xml, page-sitemap.xml, post-sitemap.xml, project-sitemap.xml and sitemap.xml to your root folder.
  3. Copy _includes/single-post-sitemap.html to your _includes folder.
  4. Edit images in single-post-sitemap.xml as described under Images below.
  5. If you do not use jekyll-archives plugin disable that as described under Categories below.
  6. Edit or remove collections sitemap as described under Collections below.

Images

Google supports adding images to the sitemap. You need to edit the image url of your post(if any) on line 5 in single-post-sitemap.html.
If you do not use images you can remove lines 4 to 8.

<image:image>
  <image:loc></image:loc>
  <image:title><![CDATA[]]></image:title>
  <image:caption><![CDATA[]]></image:caption>
 </image:image>

Categories

This plugin supports jekyll-archives. This sitemap is created with the category-sitemap.xml file. If you do not use the jekyll archives plugin you should delete category-sitemap.xml and remove the following from sitemap.xml:

<sitemap>
	<loc>https://www.christianengvall.se/category-sitemap.xml</loc>
	<lastmod>2026-10-19T16:08:17+02:00</lastmod>
</sitemap>

Collections

Since collections are dynamic only an example is added with jekyll-sitemaps. If you do not use collections you can delete project-sitemap.xml and the following from sitemap.xml:

<sitemap>
	<loc>https://www.christianengvall.se/project-sitemap.xml</loc>
	<lastmod>2026-10-19T16:08:17+02:00</lastmod>
</sitemap>

If you do use collections you need to change this:

  1. Change site.projects to site.<name-of-collection> in project-sitemap.xml    
  2. Change filename of project-sitemap.xml to <name-of-collection>-sitemap.xml    
  3. Change the reference from project-sitemap.xml to <name-of-collection>-sitemap.xml in sitemap.xml:    
<sitemap>
	<loc>https://www.christianengvall.se/<name-of-collection>-sitemap.xml</loc>
	<lastmod>2026-10-19T16:08:17+02:00</lastmod>
</sitemap>

Contribute to Jekyll Sitemaps

Jekyll sitemaps are open source and if you find a bug or something else to improve you are welcome to send pull requests.