jekyll-sitemap: baseurl not used making URL's wrong in sitemap

I’ve just used this plugin to generate a sitemap for a new blog.

In my _config.yml I have

baseurl: "/blog" 
url: "http://example.com"

And the sitemap.xml ends up been full of urls omitting /blog/

  <url>
    <loc>http://example.com/a-blog-post/</loc>

    <lastmod>2014-08-02T18:00:00+01:00</lastmod>

    <priority>0.8</priority>
  </url>

Have I missed something obvious or is this an issue?

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 15 (8 by maintainers)

Commits related to this issue

Most upvoted comments

In your _config.yml:

- url: mjohnq3.github.io
+ url: http://mjohnq3.github.io/jekyll-golden

url does not mean “hostname.” baseurl should be used only when you want a relative link. That is it’s sole purpose. When you want an absolute URL, use site.url instead of baseurl