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?
- 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. - 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.
- I confirmed that
jekyll-sitemap
comes before my pagination gem under thejekyll_plugins
group in myGemfile
. Based on what was indicated in thejekyll-sitemap
documentation, I expected that havingjekyll-sitemap
declared beforepaging-mr-hyde
would have meant that pagination should not have been a consideration for thejekyll-sitemap
plugin, and yet I'm getting paginated output in mysitemap.xml
file. - 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)
- Is there an officially supported way in which paginated urls can be excluded from the generated
sitemap.xml
document? - 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.