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

Closed
opened 2026-10-05 02:36:33 +02:00 by adam · 7 comments
Owner

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"
    }
  ],
...
**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: ```json ... "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" } ], ... ``` <!-- github-sync-id:1227244370 -->
adam closed this issue 2026-10-05 02:36:33 +02:00
Author
Owner

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.

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. <!-- github-comment-id:1119405182 -->
Author
Owner

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

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 <!-- github-comment-id:1119980938 -->
Author
Owner

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
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. <img width="694" alt="Screenshot 2022-05-12 at 20 11 34" src="https://user-images.githubusercontent.com/2900833/168148435-b71476a6-b225-4840-b041-ed0a6fc95d84.png"> Draft status for Jekyll is achieved by their folders. <img width="1054" alt="image" src="https://user-images.githubusercontent.com/2900833/168148160-47bbac08-1097-4e7c-887f-f9cb7ca6edeb.png"> <!-- github-comment-id:1125323151 -->
Author
Owner

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/

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/ <!-- github-comment-id:1125558495 -->
Author
Owner

Thanks for the help @TwoPizza9621536.

Collection forlder support has been added:

image

Thanks for the help @TwoPizza9621536. Collection forlder support has been added: ![image](https://user-images.githubusercontent.com/2900833/168221874-648d1e6c-c44f-4eef-9f26-7e179617ea93.png) <!-- github-comment-id:1125690847 -->
Author
Owner

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

Screenshot 2022-05-13 at 08 16 25

Support for the `published` field from Jekyll has also been added. ![Screenshot 2022-05-13 at 08 16 25](https://user-images.githubusercontent.com/2900833/168222703-5854ceb1-dd23-490b-8b6a-c85bdf07431d.png) <!-- github-comment-id:1125694939 -->
Author
Owner

Will be released in v7.3.0

Will be released in v7.3.0 <!-- github-comment-id:1136837787 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/vscode-front-matter#264