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

Enhancement: Automatically mark post in a folder as drafts #333

Closed
TwoPizza9621536 opened this issue May 5, 2022 · 7 comments
Closed

Enhancement: Automatically mark post in a folder as drafts #333

TwoPizza9621536 opened this issue May 5, 2022 · 7 comments
Labels
enhancement New feature or request
Projects

Comments

@TwoPizza9621536
Copy link

Is your feature request related to a problem? Please describe.
In Jekyll, there is a folder you can make called _drafts which automatically tells Jekyll that these posts should not
be processed without setting the drafts argument. In Front Matter, it does not automatically make posts in _drafts
as drafts, you have to set draft: true in the front matter which is redundant.

Describe the solution you'd like
In the configuration file, either add a drafts folder configuration or in frontMatter.content.pageFolders have a
setting called draft or something equivalent.

Additional context
The second solution presented here:

...
"frontMatter.content.pageFolders": [
    /* Directory of all of the draft/unpublished posts*/
    {
      "title": "drafts",
      "path": "[[workspace]]/_drafts",
      "drafts": true
    },
    /* Directory of all of the published post */
    {
      "title": "_posts",
      "path": "[[workspace]]/_posts"
    }
  ],
...
@estruyf
Copy link
Owner

estruyf commented May 6, 2022

Thank you for bringing this up!

Are all pages that go to the _posts folder automatically published? Or can you still use another way like the draft field to publish content?

If the _draft folder is the only way, I think it would be better to have this tighter integrated into Front Matter to support Jekyll better.

@TwoPizza9621536
Copy link
Author

TwoPizza9621536 commented May 6, 2022

Yes. and you can still use the draft field to publish/unpublish content in Jekyll. (Correction: the draft field does not work in the _posts folder) Here is a link on as on how it handles drafts.
https://jekyllrb.com/docs/posts/#drafts

@estruyf estruyf added this to To do in v7.3.0 May 10, 2022
@estruyf estruyf moved this from To do to In progress in v7.3.0 May 12, 2022
estruyf added a commit that referenced this issue May 12, 2022
@estruyf
Copy link
Owner

estruyf commented May 12, 2022

Been doing some changes for a better Jekyll support.

On the welcome experience, when you select Jekyll, it will validate if the _drafts and _posts folders exist. If they do, they will automatically get added.

Screenshot 2022-05-12 at 20 11 34

Draft status for Jekyll is achieved by their folders.

image

@TwoPizza9621536
Copy link
Author

TwoPizza9621536 commented May 13, 2022

There is also a folder that the user can set in the jekyll to store _drafts and _posts in a subfolder as it supports collections, so you want to check that in the _config.yml too.

https://jekyllrb.com/docs/collections/

Jekyll supports the unpublish frontmatter field, too.

https://jekyllrb.com/docs/front-matter/

Here is a list of configuration that Jekyll uses for front matter and _config.yml.

https://jekyllrb.com/docs/configuration/

@estruyf
Copy link
Owner

estruyf commented May 13, 2022

Thanks for the help @TwoPizza9621536.

Collection forlder support has been added:

image

@estruyf
Copy link
Owner

estruyf commented May 13, 2022

Support for the published field from Jekyll has also been added.

Screenshot 2022-05-13 at 08 16 25

@estruyf estruyf added the enhancement New feature or request label May 18, 2022
@estruyf
Copy link
Owner

estruyf commented May 25, 2022

Will be released in v7.3.0

@estruyf estruyf closed this as completed May 25, 2022
v7.3.0 automation moved this from In progress to Done May 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Development

No branches or pull requests

2 participants