Right now, Eleventy does not have a default way to filter through Markdown frontmatter. I'm using Jekyll's style, btw.
Add this to your .eleventyignore file:
**/_*.md
All draft/non-published posts get ignored when building the site.
Since it stops it before being built, it also doesn't
Via https://github.com/11ty/eleventy/issues/188#issuecomment-488350222
A programmatic method is in this post.
And another one