In the previous recipe, we created a template and externally attached bindings to a tag, and rendered the template using these bindings. This is useful when we have simple bindings. But what if we have to do some calculation and bind the calculation to the tag, rather than a simple string binding? In this recipe, we will be binding a tag to the local time on the server (or actually, a place where the template will be rendered).
Working with splice in Heist
How to do it...
- Create a new project, working-with-splice, with a simple stack template:
stack new working-with-splice simple
- Add a dependency on the heist library in the build-depends sub-section of the executable section. In addition, also add a dependency on...