Redirects insert many blank site.posts and site.pages?
soundasleep opened this issue · 5 comments
I was trying to debug a weird issue - my custom sitemap.md
was generating lots of empty posts, all pointing to "redirect.html"s, and I think the issue may be from jekyll-redirect-from.
When a post sets multiple redirect_froms, does jekyll-redirect-from insert in a new entry in site.posts
or site.pages
for each redirect source?
If so, can this be documented? Are there any properties (e.g. page.is_redirect
or post.is_redirect
) that I can use to better filter the redirect pages out of a "normal" page collection?
In the meantime, I've had to modify my custom sitemap.md
like so:
<ul class="post-list">
{%- assign all_posts = site.posts | concat: site.pages | sort: "date" | reverse -%}
{%- for post in all_posts -%}
{%- comment -%}
We need to check for post.title, because jekyll-redirect-from
adds lots of empty posts in site.posts or site.pages?
{%- endcomment -%}
{%- if post.title -%}
<li>
<a class="post-link" href="{{ post.url | relative_url }}">
{{ post.title | escape }}
</a>
</li>
{%- endif -%}
{%- endfor -%}
</ul>
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.
This is still a bug - waiting for feedback.
When a post sets multiple redirect_froms
When would someone set multiple redirects for a single post?
I am migrating a site over to Jekyll, and I have e.g.
/wiki/My Page
/wiki/My_Page
/wiki/my-page
All redirect to a single page.
I think the underlying problem still persists even if you have a single redirect from; it will create blank redirect.html
s for each redirect, even if there's only one.
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.