Enhancement: Set a 'required' parameter for a frontmatter field that will annoy editors until it is defined. #295

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

Is your feature request related to a problem? Please describe.
Some fields need to be filled in for the site design to work as intended and for SEO.

Describe the solution you'd like
Set a parameter required: true on a content type field, that will first highlight the field red when not filled out, and then raise a warning on save until the field is filled out. Basically, be annoying to the editor until the requirements are satisfied.

Describe alternatives you've considered
Telling people to remember to fill it out, checklists, pre-build script to check all files for required fields. It would be better to have some information in the UI at the time of editing, instead of after the files are saved, committed to the repo.

Additional context
Add any other context or screenshots about the feature request here.

**Is your feature request related to a problem? Please describe.** Some fields need to be filled in for the site design to work as intended and for SEO. **Describe the solution you'd like** Set a parameter `required: true` on a content type field, that will first highlight the field red when not filled out, and then raise a warning on save until the field is filled out. Basically, be annoying to the editor until the requirements are satisfied. **Describe alternatives you've considered** Telling people to remember to fill it out, checklists, pre-build script to check all files for required fields. It would be better to have some information in the UI at the time of editing, instead of after the files are saved, committed to the repo. **Additional context** Add any other context or screenshots about the feature request here. <!-- github-sync-id:1300937114 -->
adam closed this issue 2026-10-05 02:38:28 +02:00
Author
Owner

@estruyf I was asked about this today and wanted to see what you thought about it.

@estruyf I was asked about this today and wanted to see what you thought about it. <!-- github-comment-id:1216983251 -->
Author
Owner

Hi @bwklein, sorry for the delay. I am just back from vacation, so I need to get up to speed with all the things I missed.

Hi @bwklein, sorry for the delay. I am just back from vacation, so I need to get up to speed with all the things I missed. <!-- github-comment-id:1231355633 -->
Author
Owner

@estruyf no worries, I was hoping that you were off doing something fun and relaxing this summer. :D

@estruyf no worries, I was hoping that you were off doing something fun and relaxing this summer. :D <!-- github-comment-id:1232194177 -->
Author
Owner

Good news @zivbk1 @bwklein - there has been some good progress on this, and it will soon be available for testing.

Field view

Screenshot 2022-09-14 at 12 05 57

VS Code problems view and notification (can be turned off)

Screenshot 2022-09-13 at 16 06 50

Highlighted issues in the content

Screenshot 2022-09-13 at 16 06 40

Good news @zivbk1 @bwklein - there has been some good progress on this, and it will soon be available for testing. **Field view** ![Screenshot 2022-09-14 at 12 05 57](https://user-images.githubusercontent.com/2900833/190331232-4a643b30-81dc-40dd-9bed-f3bd09d206e5.png) **VS Code problems view and notification (can be turned off)** ![Screenshot 2022-09-13 at 16 06 50](https://user-images.githubusercontent.com/2900833/190331289-7728f199-8f90-4a0d-adba-3caae8c28dca.png) **Highlighted issues in the content** ![Screenshot 2022-09-13 at 16 06 40](https://user-images.githubusercontent.com/2900833/190331412-62e78761-c0f2-4aa3-8957-3108340d272d.png) <!-- github-comment-id:1247643872 -->
Author
Owner

This is now available for testing.

Configuration

  • Add the required property to the fields in your content type you want to define as a required field
  • You will automatically get the notification if you save the file and a required field is missing, if you don't want to see this notification, you can disable it with the new frontMatter.global.notifications.disabled setting and add the [requiredFieldValidation] its value.
This is now available for testing. **Configuration** - Add the `required` property to the fields in your content type you want to define as a required field - You will automatically get the notification if you save the file and a required field is missing, if you don't want to see this notification, you can disable it with the new `frontMatter.global.notifications.disabled` setting and add the `[requiredFieldValidation]` its value. <!-- github-comment-id:1247822629 -->
Author
Owner

This is excellent! Thank you.

This is excellent! Thank you. <!-- github-comment-id:1247824574 -->
Author
Owner

Changed setting to frontMatter.global.disabledNotifications.

Changed setting to `frontMatter.global.disabledNotifications`. <!-- github-comment-id:1250677757 -->
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#295