I've added a configuration variable, and discovered that jekyll already supported this with a switch, which made it much easier.
We can now choose whether future-dated posts are published by default…
… with a configuration variable. We still see all posts in preview mode.
Since jekyll already has a --no-future option, why don't we use it?
Talked with @imathis and we both agree that this is not something we'd like to see in Octopress. Heck, we think it's a silly feature to have in Jekyll at all, but alas, it is there. We're going to stick with the use of published: false in the YAML Front-Matter of a post or page if one wishes not to publish it. Thanks for the suggestion, though!
OK. I'm curious why you find it silly, in general.
@jbrains I'll try to explain it a bit better. Why would someone use this? The only reason I can think of is that someone is trying to preview generated a post, but they don't want to publish it yet. So passing a flag to jekyll seems nicer than toggling a published variable.
While it might be simpler, I would argue this makes more sense in a dynamic blogging platform like Wordpress, where setting a future dated post means Wordpress will automatically publish it for you when that date arrives. In the case of Jekyll, you'll still have to generate and publish your blog when that date arrives. In that sense I don't see much value in setting future dated posts as a way to prevent them from being published.
I do however see potential problems where posts can be accidentally published because a blogger generated and deployed, forgetting they had a another post scheduled for that day. Since Jekyll doesn't have a GUI or a way to show upcoming posts, it would be easy to accidentally do something like this.
I feel like it would be much better to use Git branches for draft management. Create a branch, generate your blog without having to worry about post dates or Jekyll flags, and when you're ready to publish, merge the branch, generate and deploy. When we finish the CLI we may set it up to pass options and flags through to Jekyll which would make it so you can use this, but for now I think it's a bad way to manage drafts and I'm not interested in adding it to the Rakefile.
Improved draft management options
- rake list_drafts shows current drafts. Closes #645
- Rake generate, watch, and preview can compile future dated posts (defaults to false). Closes #837