jekyll / jekyll-sitemap

Jekyll plugin to silently generate a sitemaps.org compliant sitemap for your Jekyll site

Home Page:http://rubygems.org/gems/jekyll-sitemap

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to exclude pagination urls from sitemap.xml

mjvezzani opened this issue · comments

What is the issue you are experiencing?

There doesn't appear to be a clear way to exclude paginated urls.

What have you already done to try and solve this issue yourself?

  1. I read the jekyll-sitemap documentation, paying close attention to the Exclusions section. The problem with excluding paginated urls is that they are not "a specific page/post". The other issue is that paginated urls are not a filetype either. I tried the methods put forth in the Exclusions section without success in generating a sitemap.xml file that did not contain paginated urls.
  2. I read this github issue in which user fabiomux put forth a solution to exclude paginated urls. Trying this solution in my own project did not result in excluded paginated urls. Also, this solution was not clear in regards to needing to exclude paginated urls from many different paths (i.e. media/articles, media/videos, media/authors, etc.) which is functionality I need in my project.
  3. I confirmed that jekyll-sitemap comes before my pagination gem under the jekyll_plugins group in my Gemfile. Based on what was indicated in the jekyll-sitemap documentation, I expected that having jekyll-sitemap declared before paging-mr-hyde would have meant that pagination should not have been a consideration for the jekyll-sitemap plugin, and yet I'm getting paginated output in my sitemap.xml file.
  4. I cloned the jekyll-sitemap code to my local machine in an attempt to better understand how it works and see if I could find a logical place to add logic for excluding paginated urls from getting included into the generated sitemap.xml file. I have been thus far unsuccessful.

In what way can the jekyll-sitemap be helpful with this issue (Be very specific)

  1. Is there an officially supported way in which paginated urls can be excluded from the generated sitemap.xml document?
  2. If not, can someone from the jekyll-sitemap team point me to where the most logical place to include code that would exclude paginated urls would be?

I tried using https://github.com/jekyll/jekyll-sitemap#exclusions and making an exclusion like this:

defaults:
  - scope:
      path: 'page/*' # also tried 'page' and 'page/**'
    values:
      sitemap: false

In this repo: https://github.com/motionsplan/motionsplan-dk-jekyll/blob/master/_config.yml#L319

But that did not work. It would be very helpful if it was possible to exclude the pagination pages from the sitemap.xml.

I also tried like explained here: #163, however, that did not work either.

This issue has been automatically marked as stale because it has not been commented on for at least two months.

The resources of the Jekyll team are limited, and so we are asking for your help.

If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.

If this is a feature request, please consider whether it can be accomplished in another way. If it cannot, please elaborate on why it is core to this project and why you feel more than 80% of users would find this beneficial.

This issue will automatically be closed in two months if no further activity occurs. Thank you for all your contributions.