EJS is familiar, as it’s primarily HTML, but with additional features that allow you to efficiently reuse pieces of your project. If you have an existing HTML project, all you have to do is rename the file with the
.ejs extension, and you can start using any of EJS’ features.
Jade, a different HTML preprocessor, also works especially well with Harp if you’d like to give it a try.
Harp’s Asset Pipeline is super easy to use. All the processing happens implicitly, so there is nothing to setup. Just name your file with an
.ejs extension rather than
.html, and Harp will see it as if it is an
This project contains an
index.ejs and an
about.ejs file in the root directory.
myproject/ |- index.ejs +- about.ejs
about.ejs will be seen as an
.html file. So, requests to the following paths will all work:
Harp's compile step will also export the files as
Managing File Extension
You may find yourself wanting to create another, markup-based file other than
.html using EJS. No problem: just prefix
.ejs with the extension of your choice. For example,
feed.xml.ejs will be served by Harp as