# Jekyll Sitemap not adding base url

**URL:** <https://talk.jekyllrb.com/t/jekyll-sitemap-not-adding-base-url/6918>\
**Category:** Help\
**Created:** [January 25, 2022, 11:22am UTC](https://talk.jekyllrb.com/t/jekyll-sitemap-not-adding-base-url/6918 "2022-01-25T11:22:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rezagray](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/rezagray/32/4283_2.png) [@rezagray](https://talk.jekyllrb.com/u/rezagray)\
**Post date:** [January 25, 2022, 11:22am UTC](https://talk.jekyllrb.com/t/jekyll-sitemap-not-adding-base-url/6918/1 "2022-01-25T11:22:45Z")

</div>

hello.  
I’m using beautiful jekyll from Dean Attali to build my personal site. so i add my site to google searcch console. and i try to submit my sitemap [https://jekyllandhyde.netlify.app/sitemap.xml](https://jekyllandhyde.netlify.app/sitemap.xml) and it got error. probably because it didnt have base url.  
how can i automaticly add my base url to sitemap ?

---

<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 25, 2022, 2:36pm UTC](https://talk.jekyllrb.com/t/jekyll-sitemap-not-adding-base-url/6918/2 "2022-01-25T14:36:02Z")

</div>

Yes it must be an absolute URL with the domain.

Can you share the theme link?

You can also try use this popular plugin instead

> **[GitHub - jekyll/jekyll-sitemap: Jekyll plugin to silently generate a...](https://github.com/jekyll/jekyll-sitemap)**
>
> Jekyll plugin to silently generate a sitemaps.org compliant sitemap for your Jekyll site - GitHub - jekyll/jekyll-sitemap: Jekyll plugin to silently generate a sitemaps.org compliant sitemap for yo...

---

<div class="post-metadata">

**Author:** ![rezagray](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/rezagray/32/4283_2.png) [@rezagray](https://talk.jekyllrb.com/u/rezagray)\
**Post date:** [January 25, 2022, 3:40pm UTC](https://talk.jekyllrb.com/t/jekyll-sitemap-not-adding-base-url/6918/3 "2022-01-25T15:40:07Z")

</div>

heres the link  
[GitHub - daattali/beautiful-jekyll: ✨ Build a beautiful and simple website in literally minutes. Demo at https://beautifuljekyll.com](https://github.com/daattali/beautiful-jekyll#:~:text=Beautiful%20Jekyll%20is%20a%20ready,blogs%2C%20or%20simple%20project%20websites.&text=You%20can%20also%20look%20at,people%20created%20using%20this%20theme).  
it had auto generated sitemap using that plugin. in local its works fine but in netlify it lost base url for sitemap

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/jekyllrb/original/2X/5/5e41e56b7a2a1673cbcf6d8f0c0656cfadf5a252.png)

---

<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 25, 2022, 3:55pm UTC](https://talk.jekyllrb.com/t/jekyll-sitemap-not-adding-base-url/6918/4 "2022-01-25T15:55:08Z")

</div>

Put your URL in:

```auto
url: https://jekyllandhyde.netlify.app
baseurl: ''

```

based on:

> <https://github.com/MichaelCurrin/jekyll-blog-demo/blob/master/_config.yml#L14-L15>

Simulate Prod locally so it uses `url` and not `localhost`.

```auto
JEKYLL_ENV=production bundle exec jekyll build --trace

```

Then verify your sitemap in `_site`.

* * *

Lastly push to Netlify.

Make sure your Netlify config’s build command or the build command on Netlify is set to this too:

```auto
[build]
  command = "bundle exec jekyll build --trace"
  publish = "_site"

[build.environment]
  JEKYLL_ENV = "production"

```

Based on

> **[Jekyll](https://michaelcurrin.github.io/code-cookbook/recipes/ci-cd/netlify/configure/jekyll.html)**
>
> Reusable code patterns which you can use as reference or copy to your project

---

<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 25, 2022, 3:57pm UTC](https://talk.jekyllrb.com/t/jekyll-sitemap-not-adding-base-url/6918/5 "2022-01-25T15:57:03Z")

</div>

I see the theme uses sitemap plugin internally

> <https://github.com/daattali/beautiful-jekyll/blob/master/beautiful-jekyll-theme.gemspec#L22>
