mojombo/jekyll — pull request #452 by mildred (2011-12-14 14:13:42+00:00)
Title: Apply converter plugins to layouts

This is a very simple patch that does two things:

- apply converters on layouts, right before they are used on a page
- Create Converter#run, and use it instead of Converter#convert. It has a second argument: the page/layout object on which the conversion is applied.

Basically, it allows to create converters that will modify layouts, HAML for example. It also enable converters to access the Page/Layout (Convertible) object. This can be particularly be useful if we want to include a page content in a layout, without using a liquid tag.

Note:

- I paid attention that the order in which the conversion and the liquid processing happens in the same order for both the layouts and the pages.
- I also made sure that the layout was converted each time it was used. it allows the layout to have dynamic content (generated by the converter) depending on which page it includes.

I didn't include tests because I don't know how I could test this new behaviour the best way possible (didn't found any tests related to plugins). Should it be a unit test or a cucumber test? Then, I suppose the test would introduce a converter plugin specially made for the test.