tapestry-cloud / tapestry

PHP static site generator using the plates template system
https://www.tapestry.cloud/
MIT License
32 stars 1 forks source link

Add datafile mutator #305

Open carbontwelve opened 6 years ago

carbontwelve commented 6 years ago

In 2.0 as part of #302 mutator classes were added as part of the source collection process, these handle such things as converting dates in the filename to a datetime object, setting draft status and parsing front matter.

Given that these are now quite powerful, it should be trivial to add the ability to look up a .yaml file within the same directory that matches the files filename and parse that as file based front matter.

Even more so a data.yaml file if found in the same path as the file should be parsed as its default front matter providing the end user a method by which they can add per directory front matter scopes. With a little more tinkering it should be possible to have data inherited from parent folders if needed - although that functionality can be a separate issue to this one.