statiqdev / Statiq.Framework

A flexible and extensible static content generation framework for .NET.
https://statiq.dev/framework
MIT License
421 stars 74 forks source link

Throw exception when `ExtractFrontMatter` is called without child modules #277

Open holly-hacker opened 4 months ago

holly-hacker commented 4 months ago

I just spent an embarrassing amount of time debugging why my ExtractFrontMatter module wasn't working, as it wasn't outputting the new modules with the front matter removed. It turns out that I had to pass in a ParseYaml or similar module to do the actual parsing of the frontmatter, or else it will not do anything. This wasn't clear from the documentation.

I suggest throwing an exception if no child module is passed, to prevent others from wasting multiple hours pulling their hair out trying to figure out how this framework works and why it's not doing what you expect :)

daveaglick commented 4 months ago

Great idea! In fact, I'm going to classify this as a bug since it doesn't make any functional sense to have a module that requires child modules silently fail if no children are there.