When building a web application that needs to render HTML templates on the frontend in as little time as possible, the compiling templates become essential. The Jade templating engine allows us to compile our templates to JavaScript Templates (JSTs) for use on the frontend.
In this recipe, we'll make use of the contrib-jade (0.12.0)
plugin to compile a template that renders a minimalistic blog.
In this example, we'll work with the basic project structure we created in the Installing Grunt on a project recipe in Chapter 1, Getting Started with Grunt. Be sure to refer to it if you are not yet familiar with its contents.
The following steps take us through creating a simple Jade template and compiling it to a JST contained in another file.
We'll start by installing the package that contains the
contrib-jade
plugin as per the instructions provided in the Installing a plugin recipe in Chapter 1, Getting Started with Grunt.Let's create a simple...