-
Notifications
You must be signed in to change notification settings - Fork 207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exclude Drafts from feed #94
Comments
I have also published a post “publically” for the purpose of sending it to somebody to proofread. I’m not sure if future date is the way to do this, seems like that could lead to some trouble if time zones or something caused Jekyll to improperly exclude a new post from the feed. Perhaps a way to explicitly exclude a post from the feed, similar to |
So we could have something like: |
👍 |
@jeremiemartinez how do you prevent future posts from appearing in your site's human-readable index? I'm wondering if rather than have the user specify the feature they want ("don't include this in the sitemap", "don't include this in the feed"), the user should expose intend ("this shouldn't be public"), and the two plugins should respond accordingly. |
@benbalter Well, my approach is very similar that the one advised by @pathawks. However, don't judge me, this is not the best code I wrote... First, I add
Your idea about a public flag that could be used for every plugin is great but it would require to directly modify jekyll to expose such an API I guess :/ |
Jekyll has a Drafts feature already: is there any way in Liquid to detect if a post is a draft? I can think of multiple reasons why a public page/post should be excluded from a sitemap (even if not excluded from the public view of a site), but the only reason I can think of to exclude a post from the site feed is if it is just a draft snd not yet “public.” I am just trying to think through this aloud. |
Draft would be a good solution but it seems that Github does not deploy drafts so I cannot ask friends for proofreading unfortunately. |
Sorry I am completely wrong with my last comment. Just need to add |
I wasn’t thinking about GitHub Pages. That makes things a bit trickier, doesn’t it. |
Well, as I corrected in my previous comment, with I looked for a way to know whether a post is a draft or not. We can with something like:
Or
What do you think about this solution? |
{% for post in site.posts %}
{% unless post.draft %}
{% endunless %}
{% endfor %}
|
Fixed by #95. |
Hey guys, any idea about a release date ? I would love to include this change in my current project! |
@jeremiemartinez v0.5.0 was just released. 😄 |
Great news ! Thanks :) |
* Use the jekyll-feed gem [1] to generate an Atom [2] feed. Drafts are automatically excluded from the feed [3]. * Add the `show_drafts` flag to my `_config.yml`, so drafts are rendered on GitHub Pages (see [4]). * Move `_posts/2017-09-02-meta.md` to `_drafts/meta.md`, so it's excluded from the feed. * Modify `home.html` so drafts aren't shown in the index of posts. * Add a new page which is an index of all drafts. * Link to the feed from the footer (instead of linking to my GitHub profile). (I want drafts to be available on GitHub Pages, so I can check how they look on my phone or send links to friends for proofreading.) [1]: https://github.com/jekyll/jekyll-feed [2]: https://en.wikipedia.org/wiki/Atom_(Web_standard) [3]: jekyll/jekyll-feed#94 [4]: jekyll/jekyll-feed#94 (comment)
Keeping consistent with [jekyll-feed plugin's support](jekyll/jekyll-feed#94).
Hi there,
What do you think about filtering future posts from the
feed.xml
?To give you some context, most of the time I write a new article, I publish it with a future date, it is not listed and I send direct link to friends for proof reading. My problem is that even if my article has a future date, it still appears in the
feed.xml
...Would you be willing to accept a PR if I work on it ? Is there any other way to filter posts appearing in the
feed.xml
?Thanks,
The text was updated successfully, but these errors were encountered: