Enhancement: False values in boolean fields shouldn't be hidden in Front Matter #622

Closed
opened 2026-10-05 02:56:50 +02:00 by adam · 2 comments
Owner

Is your feature request related to a problem? Please describe.
I have a draft field in my Astro Content Collection. When setting the field to false the whole draft line is hidden from the Front Matter, but the field is required by my Content Collection.

Describe the solution you'd like
The best way would be to have an addition property on the boolean fields to decide if false values should hide the whole line from the front matter.

Describe alternatives you've considered
I could use choices field to have different stages of the drafts, but that's only the one use case for the setting. I have other boolean values that need to be explicitly set.

**Is your feature request related to a problem? Please describe.** I have a `draft` field in my Astro Content Collection. When setting the field to false the whole draft line is hidden from the Front Matter, but the field is required by my Content Collection. **Describe the solution you'd like** The best way would be to have an addition property on the boolean fields to decide if `false` values should hide the whole line from the front matter. **Describe alternatives you've considered** I could use choices field to have different stages of the drafts, but that's only the one use case for the setting. I have other boolean values that need to be explicitly set. <!-- github-sync-id:2223641498 -->
adam closed this issue 2026-10-05 02:56:50 +02:00
Author
Owner

Hi @marekbrze, on the content type level, you can set the clearEmpty to false (also the default), which should prevent clearing/hiding the line from your front matter.

https://frontmatter.codes/docs/content-creation/content-types#content-type-properties

Hi @marekbrze, on the content type level, you can set the `clearEmpty` to false (also the default), which should prevent clearing/hiding the line from your front matter. https://frontmatter.codes/docs/content-creation/content-types#content-type-properties <!-- github-comment-id:2036509720 -->
Author
Owner

Oh, I overlooked this setting. Works now! Thanks for the help!

Oh, I overlooked this setting. Works now! Thanks for the help! <!-- github-comment-id:2036548165 -->
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#622