NancyFx/Nancy — pull request #601 by somedave (2012-04-26 15:45:08+00:00)
Title: Enhancements To DotLiquid View Engine

This includes several enhancements to the DotLiquid view engine.

In the area of performance, templates are no longer rendered to a temporary string then sent to the output stream - they are now just sent directly to the output stream. Also, the LiquidNancyFileSystem no longer uses a regular expression for matching extension names. Finally, the IRenderContext is now passed through to the LiquidNancyFileSystem which will (among other things) make it possible to return a pre-parsed DotLiquid template from the cache as opposed to reparsing templates on every include (once a pending pull request is accepted into DotLiquid).

Functionality wise, the process of locating templates for includes is improved by no longer looking at an absolute path and hardcoding the "liquid" extension into the LiquidNancyFileSystem. Instead, the IRenderContext is used to correctly locate a template based on the currently rendering module and established location conventions. The view engine extension list is now pulled from the view engine rather than being hard coded which makes it more maintainable by allowing alternate or additional extensions in the future.