Skip to content
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

Do/Don't publish future-dated posts using jekyll's built-in support #837

Closed
wants to merge 1 commit into from

Conversation

jbrains
Copy link
Contributor

@jbrains jbrains commented Dec 3, 2012

I've added a configuration variable, and discovered that jekyll already supported this with a switch, which made it much easier.

… with a configuration variable. We still see all posts in preview mode.
@jzawodn
Copy link

jzawodn commented Dec 3, 2012

+1

1 similar comment
@stulentsev
Copy link

+1

@parkr
Copy link
Collaborator

parkr commented Dec 28, 2012

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!

@parkr parkr closed this Dec 28, 2012
@jbrains
Copy link
Contributor Author

jbrains commented Dec 28, 2012

OK. I'm curious why you find it silly, in general.

@imathis
Copy link
Owner

imathis commented Dec 29, 2012

@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.

@jbrains
Copy link
Contributor Author

jbrains commented Dec 29, 2012

@jbrains https://github.com/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 get you. Here's the value I see: I don't have to be awake to publish the
posting that I scheduled. This matters for me. Instead, I have a cron job
in production that checks every 10 minutes to see whether anything has
changed, then republishes for me. I suppose a more sophisticated system
would replace this polling with generating a publication schedule from the
list of upcoming posts, although I can't tell whether that improves things
or merely complicates them.

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 don't see this as a problem, but rather avoiding a problem. By not
having to flip a "published" flag, I don't forget to publish that posting
that I wanted to publish today.

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.

Yes, but then I have to be awake to publish a posting, or I have to remind
myself to publish a posting. I can't just decide "I want this published on
Thursday", then set it and forget it.

When I researched this problem, I saw people using rake to generate lists
of posts to publish, then using sed or ruby to change "published: false" to
"published: true". It's a few dozen lines of code, and easy to get wrong.
Or it can be "--future"/"--no-future". The bottom line is that people are
using this feature, so why tell people to write it themselves when Jekyll
already does it? That's the only point of this pull request. I made sure
that the default behavior is to ignore publication dates and let people
continue to use "published" metadata per posting. (Didn't I? If I didn't,
then I deserve to be fired.)

What do you think?

J. B. (Joe) Rainsberger :: http://www.myagiletutor.com ::
http://www.jbrains.ca ::
http://blog.thecodewhisperer.com
Free Your Mind to Do Great Work :: http://www.freeyourmind-dogreatwork.com

imathis added a commit that referenced this pull request Jan 13, 2013
- rake list_drafts shows current drafts. Closes #645
- Rake generate, watch, and preview can compile future dated posts (defaults to false). Closes #837
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants