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
Add draft support for Markdown Content #89
Conversation
added a draft property on Content build site content just from non-draft content
Sources/Publish/API/Content.swift
Outdated
@@ -17,6 +17,7 @@ public struct Content: Hashable, ContentProtocol { | |||
public var imagePath: Path? | |||
public var audio: Audio? | |||
public var video: Video? | |||
public var draft: Bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this change overall. 👍 I think isDraft
would make for a more Swifty API.
I was thinking about this problem this morning as well. Initially I was thinking that |
I had a different approach. In my thinking I did not want to move around this kind of unfinished Content or put it elsewhere. My goal was to already have it in the Content folder. The site is never build with |
I have 3 concerns with the feature:
|
It is as easy as doing a search for
I am not sure that I understood your example here. But if you have a structure that would not benefit from the lightweight draft switch or solves the problem in another way you could simply not use it.
This would depend on where you are coming from. If you are coming from Hugo I.e. you would already be accustomed to the draft swift . On the other hand: you would not have to use the draft switch at all. If one prefers to solve this via a folder structure this feature is not holding you back. But I would say this is a different feature than this lightweight draft switch solution. |
I have the same requirement in my website. Would love to use this. 🙂 |
My concern is, If we choose not to process the markdowns marked with |
@Ze0nC I'm doing this with some command line arguments: These are parsed and passed as arguments to my There may be other ways, but this works well for me. |
This might be a thing. On the other hand: I did want to keep it simple and did not really see the need to preview the building result of a draft (It's Markow after all / you could temporarily remove |
For context, sometimes I cross post my articles to dev.to, and that site uses a |
I've found Jekyll's draft system to be incredibly simple. All drafts are kept in a Consider the case where you have a long lead piece. This could be a well researched paper or an entry about an involved build that's in process. It could sit in drafts for weeks. Maybe you have an idea for a short story that you want to edit around. The scrap of something you don't want to lose, but isn't ready to be placed into your file structure. Over a long enough period of time, your published work pieces is going to grow. They represent Done. Your There are a lot of ways to have Publish directory trees structured to store your finished pieces. If you keep having drafts nested in something like Looking at this feature consider how does it affect the level of effort onboarding a user with minimal programming knowledge. |
I don't think Publish should have an opinion on how drafts should be handled, since different people will want to organize their drafts differently. For example, I'm with @dpfannenstiel, and personally don't think it's a good idea to mix drafts with production content (I use a dedicated Since Publish already supports custom metadata, you could always implement the functionality that you're looking for by adding a Another approach (that I would be willing to accept a PR for) would be to add a So, I'm sorry, but this PR won't be accepted, as I don't think the current implementation should be a part of Publish's official API. Thanks anyway @mimorocks. |
this adds support for a draft property in your Markdown files
draft: true
This can mark content as Work-in-Progress that should not yet be included in your build site.
Site is build just from non-draft content then
default is draft = false for not defined property