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

Revise and improve publishing logic #1492

Merged
merged 7 commits into from Apr 15, 2014
Merged

Conversation

maul-esel
Copy link

This PR refactors the publishing logic by moving it out to a Publisher class. It also adds the possibility to mark a page as published: false, as already possible for posts (thus this supplements and closes #1080), and a new --unpublished flag to render such posts and pages.

end

def publish?(thing)
can_be_published?(thing) && !hidden_in_the_future?(thing)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awful naming for both, I know. Couldn't come up with any idea though. Can you?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's nothing wrong with the naming here. 😃

@mattr-
Copy link
Member

mattr- commented Sep 3, 2013

Seems ok, although I don't understand the difference between --unpublished and --drafts in most cases.

@parkr
Copy link
Member

parkr commented Sep 3, 2013

@mattr- --unpublished is for posts and --drafts is for drafts. 😉

@mattr-
Copy link
Member

mattr- commented Sep 3, 2013

i.e. for future dated posts?

@parkr
Copy link
Member

parkr commented Sep 3, 2013

@mattr- Correct! :)

@maul-esel
Copy link
Author

@mattr-, @parkr: Incorrect!

  • --drafts is for drafts, i.e. files in the _drafts folder.
  • --future is for future dated posts
  • --unpublished will be for posts with published: false in their frontmatter

@mattr-
Copy link
Member

mattr- commented Sep 3, 2013

Wow, three flags for this? Seems like overkill. Is there a way we can
improve the situation?

On Tue, Sep 3, 2013 at 1:03 PM, maul-esel notifications@github.com wrote:

@mattr- https://github.com/mattr-, @parkr https://github.com/parkr:
Incorrect!

  • --drafts is for drafts, i.e. files in the _drafts folder.
  • --future is for future dated posts
  • --unpublished will be for posts with published: false in their
    frontmatter


Reply to this email directly or view it on GitHubhttps://github.com//pull/1492#issuecomment-23733789
.

@maul-esel
Copy link
Author

Well, three flags for three similar yet different features. Can't really drop the features or the two existing flags because of incompatibility, so the only possible (though probably not recommendable) thing would be some option --render_all that combines them. I guess the request for a flag only to render unpublished posts would pop up again soon though. 😉

So it seems to me there's no good way to avoid having three flags.

@mattr-
Copy link
Member

mattr- commented Sep 3, 2013

Something to keep in mind for Jekyll 2.0. 😃

On Tue, Sep 3, 2013 at 1:23 PM, maul-esel notifications@github.com wrote:

Well, three flags for three similar yet different features. Can't really
drop the features or the two existing flags because of incompatibility, so
the only possible (though probably not recommendable) thing would be
some option --render_all that combines them. I guess the request for a
flag only to render unpublished posts would pop up again soon though. [image:
😉]

So it seems to me there's no good way to avoid having three flags.


Reply to this email directly or view it on GitHubhttps://github.com//pull/1492#issuecomment-23735276
.

@maul-esel
Copy link
Author

Should be ready to be 🚢ed.

@parkr
Copy link
Member

parkr commented Sep 15, 2013

Re-reading the code, I think there's still a bunch of entanglement. What if we just passed metadata or something to a class method in a #published? method? Not suuuuure about this yet.

@maul-esel
Copy link
Author

@parkr: OK, so I re-did this, trying to do what you said, hopefully understanding you correct. Could you have a look at this and if that's basically what you meant, I'll open a new PR for this?

Then the _site directory should exist
And the "_site/index.html" file should exist
And the "_site/public.html" file should exist
And the "_site/secret.html" file should exist
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The published flag is also valid for posts. Could you please add a similar example with posts instead of pages?

@parkr
Copy link
Member

parkr commented Oct 24, 2013

Looks like there is a merge conflict here with current master, too.

@maul-esel
Copy link
Author

Ok, I think you might have missed what I meant. My mistake though, that link in my previous comment is basically invisible. So the re-done stuff is here: maul-esel/jekyll@master...publisher.

@parkr
Copy link
Member

parkr commented Apr 7, 2014

This needs a rebase. Would you mind, @maul-esel?

@maul-esel
Copy link
Author

@parkr: No problem, done!

@maul-esel
Copy link
Author

Oops, sorry, my master branch was out of date. Now it should be fine.

mattr- added a commit that referenced this pull request Apr 15, 2014
@mattr- mattr- merged commit 6be33cf into jekyll:master Apr 15, 2014
mattr- added a commit that referenced this pull request Apr 15, 2014
@maul-esel maul-esel deleted the publishing branch April 15, 2014 04:46
@jekyll jekyll locked and limited conversation to collaborators Feb 27, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants