Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unexpected urls in my Jekyll website sitemap

Tags:

I'm creating my personal blog (davioooh.com) using Jekyll and hosting it on GitHub pages.

But I recently discovered a strange thing...

When pushed/deployed to my repository, the blog sitemap.xml includes two extra urls:

<url>
  <loc>
    http://davioooh.com/assets/javascript/anchor-js/docs/grunticon/preview.html
  </loc>
  <lastmod>2017-08-11T16:40:49+00:00</lastmod>
</url>
<url>
  <loc>
    http://davioooh.com/assets/javascript/anchor-js/docs/index.html
  </loc>
  <lastmod>2017-08-11T16:40:49+00:00</lastmod>
</url>

I can't understand why... I'm not using any anchor-js gem or plug-in...

The only gems declared in my _config.yml and Gemfile are:

gems:
  - jekyll-feed
  - jekyll-seo-tag
  - jekyll-paginate
  - jekyll-sitemap

So why I'm getthing that urls?

NOTE: the sitemap is correct when I test the site locally on my dev machine.

NOTE: I'm using a custom theme (regular theme, not gem-based). No theme declared in my _config.yml. Here you find my blog repository: https://github.com/davioooh/davioooh.github.io

UPDATE Tried to replace jekyll gem with github-pages in my Gemfile as suggested by marcanuy. It works locally, but after a new push sitemap still includes the extra urls...

UPDATE Found GitHub pages reference listing default params for Jekyll websites. Default theme is, as expected, jekyll-theme-primer. How can I override this setting if I'm not using gem-based theme?

like image 228
davioooh Avatar asked Aug 14 '17 08:08

davioooh


2 Answers

It comes from your theme: jekyll-theme-primer

Primer is what powers GitHub's frontend. If you're not using this theme explicitly, it probably comes from GitHub Pages' own usage of the Primer framework

like image 118
ashmaroli Avatar answered Sep 29 '22 23:09

ashmaroli


Why it works fine locally?

Because you are not using the same dependencies Github Pages uses. To replicate the environment used by Github, you need to use the gem: github-pages.

Why sitemap.xml includes two extra urls?

As @ashmaroli said, these files comes from jekyll-theme-primer which is used by Github Pages, if you are using your own theme files, then just make sure there are no theme: key in your _config.yml and run bundle update. Using the right github-pages gem will fix it and those files won't be included in your final site.

like image 22
marcanuy Avatar answered Sep 30 '22 00:09

marcanuy