Now, there’s some serious cruft in there –
First, I’m faking up a template. Fluid has a liquid
tag which allows you to write Liquid script without tags. I’m surrounding the provided source code with one of these.
Second, Fluid has a Captured
delegate that will execute whenever the capture
tag is invoked. However, it doesn’t do the same thing for assign
. In another project, I altered the Fluid code to do this on assign
(it involved pasting 2-3 lines of code), but I wanted to do this with default Fluid, so you can see I actually concatenate a bunch of capture
tags at the bottom. Those tags invoke the delegate which write back to the dictionary.
(I ran this concept of Fluid as a general procedural language by Sebastian, the creator of Fluid. He’s a little horrified by it, since this very much not what Fluid is designed for, but he conceded that it was workable.)
The tests looked like this: