Enhancement: "Do not insert if empty" options within Snippets #754

Closed
opened 2026-10-05 03:03:52 +02:00 by adam · 4 comments
Owner

First, thank you for all your work with Frontmatter. Frontmatter makes maintaining static websites so much easier.

Have you considered an option, so empty fields in Snippets are not inserted, like a global "Do not insert if empty" options within Snippets, or maybe even a similar option pr. Snippet?

Thanks
--Jesper

First, thank you for all your work with Frontmatter. Frontmatter makes maintaining static websites so much easier. Have you considered an option, so empty fields in Snippets are not inserted, like a global "Do not insert if empty" options within Snippets, or maybe even a similar option pr. Snippet? Thanks --Jesper <!-- github-sync-id:3374990244 -->
adam closed this issue 2026-10-05 03:03:52 +02:00
Author
Owner

Hi @dotjesper,

Thank you for the feedback 🙏.

Snippets make use of Mustach JS so that you can use statements like: [[#title]]title=\"[[&title]]\"[[/title]] to only include a value if it is not empty. That should be a solution to your issue.

Hi @dotjesper, Thank you for the feedback 🙏. Snippets make use of Mustach JS so that you can use statements like: `[[#title]]title=\"[[&title]]\"[[/title]]` to only include a value if it is not empty. That should be a solution to your issue. <!-- github-comment-id:3244457217 -->
Author
Owner

Awesome, I will try that out - thanks

--Jesper

Awesome, I will try that out - thanks --Jesper <!-- github-comment-id:3244606854 -->
Author
Owner

Works perfect - thanks!

Works perfect - thanks! <!-- github-comment-id:3245577512 -->
Author
Owner

Thanks for the update! 💛

Thanks for the update! 💛 <!-- github-comment-id:3245619089 -->
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#754