Support invert Property for Boolean Type Fields in contentTypes configuration
#916
chriskyfung
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I would like to suggest adding support for the
invertproperty for boolean type fields in thefrontMatter.taxonomy.contentTypesconfiguration. This feature would allow users to invert the logic of boolean fields, making it easier to handle scenarios where the absence of a field should be interpreted asfalse.Use Case
A common scenario where this feature would be useful is when a user wants to exclude a page from the sitemap. In Jekyll, this can be achieved using the
jekyll-sitemapplugin by addingsitemap: falseto the page front matter. Here is an example:Current Issue
Currently, when defining a boolean field in the
frontMatter.taxonomy.contentTypesconfiguration as follows:{ "title": "Sitemap", "name": "sitemap", "type": "boolean" }The behaviors in the editor panel:
sitemap: truein the front matter.sitemapfield from the front matter.These behaviors do not allow for the explicit setting of
sitemap: false, which is necessary to exclude a page from the sitemap.Proposed Solution
By adding support for the
invertproperty, users could define the boolean field as follows:{ "title": "Sitemap", "name": "sitemap", "type": "boolean", "invert": true }With this configuration:
sitemap: falsein the front matter.sitemapfield from the front matter.This would allow users to explicitly set
sitemap: falseto exclude a page from the sitemap, aligning with the behavior of thejekyll-sitemapplugin.Benefits
Supporting the
invertproperty for boolean type fields in thefrontMatter.taxonomy.contentTypesconfiguration would be a valuable addition, enabling users to better manage their content and configurations. I hope you consider this feature request for future updates.Beta Was this translation helpful? Give feedback.
All reactions