jekyll / jekyll-redirect-from

:twisted_rightwards_arrows: Seamlessly specify multiple redirections URLs for your pages and posts.
MIT License
780 stars 112 forks source link

How to disable redirects.json? #189

Closed TWiStErRob closed 5 years ago

TWiStErRob commented 5 years ago

Re #147 I updated from an older Jekyll version and now my site has an extra redirects.json file. That lurks into sitemap and rss feed.

Question is simple how can I disable generating that file?

I tried this without luck:

exclude:
  - redirects.json
TWiStErRob commented 5 years ago

also tried (with and without slash)

defaults:
  -
    scope:
      path: '/redirects.json'
    values:
      sitemap: false
jekyllbot commented 5 years ago

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.

TWiStErRob commented 5 years ago

@benbalter @DirtyF do you need some info on this?

pathawks commented 5 years ago

I am unable to reproduce this issue in our CI suite. The following test already passes: https://github.com/jekyll/jekyll-redirect-from/blob/6f80c6b413406dd254fa8f0789eae34d3dc3f8de/spec/integrations_spec.rb#L88-L91

TWiStErRob commented 5 years ago

Hmm, I'll have to double check and create a repro then.

jekyllbot commented 5 years ago

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.

KasparEtter commented 5 years ago

Can we please reopen this issue? I don't know much about Ruby and haven't studied the code of this plugin but the following line suggests to me that the file redirects.json is created whenever it doesn't exist without an option to switch this off: https://github.com/jekyll/jekyll-redirect-from/blob/21d18e0751df69a0d1a6951cb3462c77f291201b/lib/jekyll-redirect-from/generator.rb#L25

I want to be able to redirect certain pages without exposing all redirected pages to the public. While creating an empty redirect.json in the "source directory" solves this, it isn't a particularly elegant solution.

smkelly commented 5 years ago

A workaround for this can be accomplished by:

The first step makes this plugin not generate a destination file since a source one exists. The second step tells Jekyll to not spit out your redirects.json in your destination directory.

Ideally, this plugin should have an option to make this call optional.

ashmaroli commented 5 years ago

Y'all are welcome to submit a Pull Request.

dmalan commented 4 years ago

We were just trying to disable this as well, actually. Here's one possible option, https://github.com/jekyll/jekyll-redirect-from/pull/207!