yesodweb / shakespeare

Haml-like template files that are compile-time checked
http://www.yesodweb.com/book/shakespearean-templates
MIT License
136 stars 76 forks source link

Make embedded files be resolved by project root #266

Closed ivb-supercede closed 2 years ago

ivb-supercede commented 2 years ago

Because file embedding runs IO in the Template Haskell Q monad, relative file paths are resolved by the compiler's working directory. Ordinarily, this is the root of the project being built - but if the compiler is e.g. building a dependency, it can also be different.

This change makes it so that template files are always embedded relative to the project that contains the code embedding them, rather than the working directory of the compiler - this means that dependencies in a multi-project codebase can embed files correctly.

ivb-supercede commented 2 years ago

Just noticed messages have the same issue, so I'll fix those too.