Is there a Hugo function to delete markdown files from the content folder?

I’m wondering if Hugo has any built-in functions or methods to delete markdown files from the content/ folder during the build process or through Hugo’s templating system.

Specifically, I’m looking for a way to programmatically remove .md files from the content directory using Hugo’s functions, rather than manually deleting them from the filesystem.

Is this possible with Hugo’s current functionality? If not, what would be the recommended approach to achieve this?

No.

meaning “identify the files you need to delete” based on some calculations done in “hugo with templates/partials” . If so you could create a delete.json or text file while building the site and have an external post build step.