Is there a way to include html file or snippet directly in jade?

jason chen picture jason chen · Jul 28, 2013 · Viewed 29.3k times · Source

I have a set of html files, mostly static, I would like to move to my node.js/express/jade project. What's the right way to include html file or snippet directly in jade? I don't want to translate existing html file to jade?

Answer

Jonathan Lonowski picture Jonathan Lonowski · Jul 28, 2013

You should be able to simply include it within a jade template:

As mentioned include can be used to include other content such as html or css. By providing an extension, Jade will read that file in, apply any filter matching the file's extension, and insert that content into the output.

html
  // ...
  body
    // ...
    //- html files have no filter and are included verbatim
    include content.html