-
-
Notifications
You must be signed in to change notification settings - Fork 10k
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
Jekyll command to publish a draft #1469
Comments
I was just thinking the same thing. It does feel to me like a natural extension of the drafts feature. |
Great idea! That error is usually due to a Syntax Error. Within your fork, run |
@benbalter @mattr- what do you think of this? |
@parkr thanks for your help i was able to track down the issues and it seems to be building and running the tests now. Ill try and hack around this weekend and see what I can come up with. |
I like it. When could we see some code? 😃 On Thu, Aug 29, 2013 at 11:41 AM, Zac Siegel notifications@github.comwrote:
|
I've been giving this some thought, and I've actually started to open an issue several times called "deprecate drafts", but haven't gone through with it. I think drafts as a feature encourage the wrong workflow. The command to publish a draft should be The amazing thing about Jekyll is that it treats content as code. It wraps your code in the same satin blanket that is GIt as geeks do with the software they use to publish that same content, and that makes a heck of a lot of sense. After all, the content is the important part, not the platform. Geeks care about code, and if so much as a single line is off, things break. That's why we have great tools, and that's why applying that workflow and that philosophy to content is so powerful. The draft feature breaks that flow. It says hey, even though we have this amazing tooling that allows us to create parallel versions, save them, version them, expose them early on for feedback from others... lets ignore all that and invent our own system to stage content. We don't do that with code, we shouldn't do that with text. Here's how a draft flow should work if we want to encourage flow:
That process isn't for everyone, but we can build tooling to fix that. What if Caveat: This assumes you're using git, which up until now, Jekyll does not. We'd either want to make that assumption, or have a non-git fallback to the existing workflow. |
I think that wouldn't enable the 'browse your drafts, and see which you feel like developing a bit more' kind of workflow which it currently encourages. I think that's kind of what it's built around. |
@benbalter Great thoughts. Seems so simple now that you mention it. 😃 With Ben's example, you'd have a different feature branch for each draft. |
If I had to switch one by one between drafts that would ruin the feature for me. There's something about having them all displayed next to each other that helps you realize which one should see the light of day next. |
Whoa whoa hold your 🐴! We can't assume everyone uses Git (as Ben mentioned) and I'd feel really uncomfortable about integrating git with Jekyll so tightly. It's enforcing a workflow that isn't flexible – what if I work in a different way? I'll submit a PR to modify the workflow or never use this feature. Integrating git is a can of worms I don't want to open. All we want is an automated way to move a file from The idea is brilliant and the workflow certainly works for some, but I don't think it's within the domain of Jekyll to enforce this. It's more in the domain of Octopress than Jekyll. |
I kind of agree with Parker. I was thinking about a basic command that would move and date the draft appropriately. Obviously I could do this with shell scripting or other methods on my local machine but I thought it might be a nice extension to the drafts functionality. Within the git workflow Ben mentioned I could see the following…
|
Nobody ever said we would be integrating Git in to Jekyll or enforcing a workflow. We're just having a discussion about workflows. Let's calm down, shall we? 😃 Do I think using git to manage your workflow makes sense? Sure I do, so I'll make it my workflow and not force it on any one else. Ultimately, Jekyll's workflow is based around having a particular directory structure and putting things in the appropriate buckets in that structure. That's it. Whether or not we have helpers for that in Jekyll core is a discussion we need to have. |
👍 |
@parkr agree with everything you're saying, and that's why I caveated that any tooling can't exclusively assume git, but one word of caution:
(setting aside the fact that regardless of implementation a Tooling and defaults are more powerful than you think. We're building Jekyll around a certain workflow as is. That workflow involves a A Yes, we can't assume Git (although I'd argue 80%+ of the time that's how Jekyll's managed) , but I'd rather build against the ideal workflow, and fall back when we have to, not settle for second best because it's what we've done in the past. |
I agree 100 %. Git has already everything. Jekyll’s draft feature is build for one-man-blogs of day dreamers who start 100 posts and never finish them. It’s not really multi-user ready. BTW, the draft feature was forced 8 months ago by @scribu, the Wordpress guy. It’s a implementation of the Wordpress staging workflow, I always hated. How many people really use this feature since it’s introduced? The fact it’s for posts only just shows how unnecessary draft is. Look at Jekyll’s documentation. It’s built with pages, not posts. Different contributors start new pages, make pull requests, get things done. There are |
@scribu I mean you had implemented the whole feature. Please don’t split hairs. If I look at the Jekyll powered blogs of the 6 participants in #769 I can’t see nobody who actually uses the draft feature. @scribu, @FellowMD, @zsiegel: What is your experience with drafts?
|
How exactly do you expect to see them using the feature?
Yes.
100%.
I don't know any Jekyll only bloggers; sorry. |
It sounds like you find the whole posts feature of Jekyll unnecessary, in which case complaining about drafts is just trolling. |
@mojombo wanted a native drafts feature at the time. Maybe he's changed his mind, but I haven't heard from him in a month or so. I really like our drafts feature as it is and don't see a reason to deprecate it. I'd be happy to add the alternative git-only workflow (using solely posts) to the docs under "working with drafts". @benbalter the biggest reasons I don't like the workflow you proposed are (1) the overhead of modifying the publish date of a post that is a WIP for more than a day is annoying; (2) no way to preview the PR on GH Pages. The |
I search in their public blogs source for |
That's because it's ignored: https://github.com/mojombo/mojombo.github.io/blob/master/.gitignore#L1 I also ignore it for my own blog. |
Granted, I also have two little bash scripts, so my workflow looks like this:
Without these little utilities, I can understand why drafts might seem unnecessary. That's what this ticket is trying to address. |
@scribu you and I have worked together before on WP unit tests, among other things. Please know, that I in no way intended to imply any impropriety on your part. ❤️ that we find ourselves working on such diverse projects together yet again. 😄
Too many to deprecate it, which is why I never open the issue. I'm not saying we should get rid of drafts. We can't at this point. My argument is that if we're going to be building new tooling around a feature, I'd love the feature to fit into a bigger vision, rather than just bolting on things because they make sense after we did something last week. If we're going to invest the time in tooling to reduce a pain point, lets use it as an opportunity to make it easier to do the right thing, not easier to do what is arguably a janky work around.
Spot on. The feature as it is now lacks tooling. I think we can all assume that as a given.
This issue is designed to fix just that. The discussion is whether we should build towards a
Moving meaning placing each current draft in a branch? Totally agree, but I'd argue you're an edge case, or even if not, the feature's only been around since 1.0.
...which is why I'm proposing tooling that uses the branch workflow if the site is versioned in Git, otherwise falling back to the |
Hey @benbalter!
And you'd also have to account for the case where the site is versioned in Git, but As a more general note, you seem to be saying two slightly contradictory things:
Pick one. |
Nevermind that last note. I re-read the whole thread and the gist seems to be: Let's add tooling for the branch-based workflow, because it's better; but, since we can't get rid of _drafts, let's support that too. |
I understand your workflow. You don’t want to share your drafts with public, until they are ready to publish as a regular post. So it’s not only technical decision but also a psychological one. This method works for one-man blogs only. If you want to build a magazine with reporters, editors and so on, it doesn’t really work anymore. The git based workflow scales for every team size. If you start a new branch I hope the draft feature supports you by writing. |
Which to clarify, you don't have to do with a branch-based workflow either. Just don't push the branch. Also, having a bunch of drafts just sitting on my hard drive and not backed up anywhere would scare the 💩 out of me. To the ☁️! |
The assumption is that git branches and _drafts are mutually exclusive. But what's wrong with opening a pull request against a file in the |
@benbalter I agree again. The current draft feature is just a little helper. The branch-based workflow is the most promising code writing style of today’s world. |
Totally valid question. 1) it's not proper git-flow ( |
And please remember the possible assets for your drafts: images, videos, archives, etc. The draft feature can not handle these files. |
Ok, those are valid points. How does Octopress handle drafts again? |
They use |
I don't know what to say. On the one hand, In both cases, the tooling doesn't really need to be shipped with Jekyll, so maybe it would be best to leave it for third-parties, for now. Maybe @benbalter will write an extension that will knock our socks off. :) |
From a single author standpoint, it's really helpful to have many draft posts percolating in the background. I personally have my drafts on my Dropbox, with a symlink of _drafts->~/Dropbox/drafts. Professional writers may have one article they work on until it's done, but amateur single authors aren't sure what we want to publish until we've written it. Kicking my ass to meet a deadline isn't necessary. |
I think I phrased the question wrong. There's nothing stopping you from creating the draft in the branch. And whether you start off in the So, I still think that the |
You are correct. |
Just pointing out his utility that I'll probably start using |
Stumbled across this when looking for a command to publish from _drafts to _posts. $ ./bin/publish _drafts/my-new-post.md Moves post and prefixes with current date. |
I have written a Python script for publishing drafts: https://github.com/MartinThoma/MartinThoma.github.io/blob/source/publish.py It does the following:
|
I think you could close this issue now, as the |
My $0.0.2:
Otherwise, I agree, this shouldn't go in core. |
Going to take care of this over in https://github.com/jekyll/jekyll-compose 😃 |
It would be great to have a command to publish a draft.
For example if you did
jekyll publish _draft/path-to-draft.md
it would move the file into your _posts folder and date it with the current date.I would love to help implement the feature but I cannot seem to get jekyll to build on my machine.
When trying to build I get the following error. I might be totally missing something but any nudge in the right direction or quick steps to building and iterating would be great.
(master)$ jekyll build --trace /Users/zsiegel/.rvm/gems/ruby-1.9.3-p194/gems/commander-4.1.5/lib/commander/runner.rb:365:in
block in require_program': program version required (Commander::Runner::CommandError)`Thanks!
The text was updated successfully, but these errors were encountered: