jekyll / jekyll-feed

:memo: A Jekyll plugin to generate an Atom (RSS-like) feed of your Jekyll posts
MIT License
837 stars 203 forks source link

Filter drafts #333

Open pgstef opened 3 years ago

pgstef commented 3 years ago

Hi,

I saw in a few closed issues that drafts posts should be filtered out from the generated feed xml. Is it true? I use github-pages to build my blog, and the show_drafts: true property works using {% if post.draft %} to preview the posts in a drafts section.

However, those drafts are automatically published in the feed.xml too. Is it normal? How to prevent it? Is it possible to write a custom feed xml file that would automatically be updated when adding new posts (with specific tags)?

I'm probably missing something here. Many thanks in advance for your help.

jekyllbot commented 3 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.

pgstef commented 3 years ago

Issue still occurring. Please have a look at it ?

jekyllbot commented 3 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.

meribold commented 3 years ago

Drafts used to be excluded from the generated feed. It seems https://github.com/jekyll/jekyll-feed/pull/316 changed this. I just updated jekyll-feed and was surprised to see my drafts pop up in my feed reader.

jekyllbot commented 3 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.

meribold commented 2 years ago

This is still relevant. I think the options are reverting #316 or adding some kind of configuration flag that restores the old behavior.

ashmaroli commented 2 years ago

@parkr What do you think would be the best path forward considering the fact that this is a whitelisted plugin on GitHub Pages?

parkr commented 2 years ago

I'd add a show_drafts config under feed to filter them. The global show_drafts field is really meant for non-production environments, like local or a Netlify Preview deploy.

jekyllbot commented 2 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.

meribold commented 2 years ago

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

I don't expect anyone to volunteer their time working on this issue, but @jekyllbot doesn't seem helpful. Why not just leave issues open even if there isn't much activity? Here's a pretty good case against using bots that automatically close issues: https://drewdevault.com/2021/10/26/stalebot.html.

parkr commented 2 years ago

Sorry about jekyllbot. The motivation there is to cut down on noise for the maintainers by ensuring that the open issues are ones that are still occurring and still important to the user. On a big project like Jekyll you get a lot of drive-by issues for folks that never follow up. Many folks use the Jekyll issues for support too but we prefer folks to use talk.jekyllrb.com for help with installing etc. Anyway, I pinned this issue so Jekyllbot should stop following up.

My solution here would be to add a flag to config.yml. Since we're pre-1.0, stability is not guaranteed per semver. I think the right behavior is: if show_drafts is true, then show everywhere (including the feed) unless explicitly turned off for the feed.

show_drafts: true
# no feed config, show in feed
show_drafts: true
feed:
  include_drafts: false
# don't show in feed

Adding a flag makes things just a little more complicated but the use cases are valid for both scenarios.

By the way, Netlify and Heroku would gladly deploy a draft site from a pull request that you can share to others. This isolates the changes you want reviewed from your "production" environment and might be the best option moving forward for sharing drafts with others and previewing on mobile.

meribold commented 2 years ago

I pinned this issue so Jekyllbot should stop following up.

Thanks!

By the way, Netlify and Heroku would gladly deploy a draft site from a pull request that you can share to others. This […] might be the best option moving forward for sharing drafts with others and previewing on mobile.

You're right and I have actually set up something similar for my website in the meantime. I.e., (speaking only for myself) I don't really need the ability to exclude drafts from feeds anymore. Back in 2016 there were quite a few people in issue #94 and PR #95 that wanted drafts to be excluded from feeds, but this issue barely has drawn any interest since it's been opened about a year ago. Perhaps it's become much more common to only push drafts to a testing environment since then. OTOH, having an include_drafts: false option might still be useful for GitHub Pages users.

pgstef commented 2 years ago

OTOH, having an include_drafts: false option might still be useful for GitHub Pages users.

Very useful :-) I'm indeed using GH Pages (because it is very easy to use for my simple/basic use-case)