Enhancement: Allow boolean choice to provide a string value #128

Closed
opened 2026-10-05 02:26:39 +02:00 by adam · 5 comments
Owner

The draft status in Pelican is not a boolean, but a string. I have removed the default boolean option, but I really the toggle would be a great option.

Having an option/choice for the boolean to provide a string opposed to true/false would be a great solve. This would make the dashboard actually useful when looking for "In draft" articles.

The draft status in [Pelican](https://docs.getpelican.com/en/latest/content.html) is not a boolean, but a string. I have removed the default boolean option, but I really the toggle would be a great option. Having an option/choice for the boolean to provide a string opposed to true/false would be a great solve. This would make the dashboard actually useful when looking for "In draft" articles. <!-- github-sync-id:1034163569 -->
adam closed this issue 2026-10-05 02:26:39 +02:00
Author
Owner

Sounds like a good functionality to improve.

Might have to introduce a new setting for this in order to specify what field to use. So that the dashboard can check its type.

Sounds like a good functionality to improve. Might have to introduce a new setting for this in order to specify what field to use. So that the dashboard can check its type. <!-- github-comment-id:950672660 -->
Author
Owner

Hi @apowell656,

The first implementation is completed.

In order for it to work, you need to do the following steps:

  • Specify the new frontMatter.content.draftField setting, with for instance the following configuration:
"frontMatter.content.draftField": {
  "name": "draft",
  "type": "choice",
  "choices": ["draft", "in progress", "published"]
}
  • In the content type, specify the field type to use for the draft field to draft instead of boolean.
  • Once both steps are completed, the dashboard will show tabs with the different specified choices, and instead of a toggle, it will show a dropdown.
Hi @apowell656, The first implementation is completed. In order for it to work, you need to do the following steps: - Specify the new `frontMatter.content.draftField` setting, with for instance the following configuration: ``` "frontMatter.content.draftField": { "name": "draft", "type": "choice", "choices": ["draft", "in progress", "published"] } ``` - In the content type, specify the field type to use for the draft field to `draft` instead of `boolean`. - Once both steps are completed, the dashboard will show tabs with the different specified choices, and instead of a toggle, it will show a dropdown. <!-- github-comment-id:950797047 -->
Author
Owner

You are now able to test it out in the beta version.

You are now able to test it out in the beta version. <!-- github-comment-id:950826177 -->
Author
Owner

@estruyf this works great! Thank you for adding this enhancement.

@estruyf this works great! Thank you for adding this enhancement. <!-- github-comment-id:950922662 -->
Author
Owner

Thanks @apowell656 for verifying!

Thanks @apowell656 for verifying! <!-- github-comment-id:951019971 -->
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#128