# \- jekyll-sitemap: adding url that are not in the project

**URL:** https://talk.jekyllrb.com/t/jekyll-sitemap-adding-url-that-are-not-in-the-project/6920
**Category:** Help
**Created:** [January 25, 2022, 4:05pm UTC](https://talk.jekyllrb.com/t/jekyll-sitemap-adding-url-that-are-not-in-the-project/6920 "2022-01-25T16:05:33Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![MichaelCurrin](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/michaelcurrin/32/2340_2.png) [@MichaelCurrin](https://talk.jekyllrb.com/u/MichaelCurrin)
#### Post date: [January 26, 2022, 9:36am UTC](https://talk.jekyllrb.com/t/jekyll-sitemap-adding-url-that-are-not-in-the-project/6920/3 "2022-01-26T09:36:12Z")

</div>

Redirects will be okay provided you do _not_ cross domains. i.e. `username.github.io/abc` to `http://username.github.io/xyz` is fine.

I have a hack in my Jekyll site to build a sitemap that contains the homepages of almost _all_ my GH Pages sites.

> <https://github.com/MichaelCurrin/MichaelCurrin.github.io/blob/master/sitemap.xml>

## How it works

The site itself is just a one-page site.

So line 8 handles that and gives this result:

```auto
<url>
<loc>https://michaelcurrin.github.io</loc>
<lastmod>2021-12-20T12:07:43+00:00</lastmod>
</url>

```

Other sites are rendered like this:

```auto
<url>
<loc>https://michaelcurrin.github.io/auto-tag/</loc>
<lastmod>2021-12-20T12:07:43+00:00</lastmod>
</url>
<url>
<loc>https://michaelcurrin.github.io/badge-generator/</loc>
<lastmod>2021-12-20T12:07:43+00:00</lastmod>
</url>

```

Based on a manually-maintained data file of all my sites.

> <https://github.com/MichaelCurrin/MichaelCurrin.github.io/blob/master/_data/gh_pages_sites.json>

There is some duplication in here of course - one just needs the `name` field and the `url` from the config to infer the full URL, but anywhere it works.

I think I got the data from a GH API GraphQL query to look up all my sites and their URL. Let me know if you want that query.

---

_[View the full topic](https://talk.jekyllrb.com/t/jekyll-sitemap-adding-url-that-are-not-in-the-project/6920)._
