I've read and re-read the jade references and a whole bunch of stack overflow questions but I can't seem to figure this out and I think it should be really simple.
So all I want to do is have an object in a JavaScript file, and have that imported into my jade file so I can use the data from the object when generating my html page.
for example:
This would be in a JS file:
var obj = {
firstName: "bob",
lastName: "smith",
age: 109
};
And in my jade I want to do this:
h1 #{obj.firstName}, #{obj.lastName}
h2= obj.age
etc.
This is just a simple example. Any help at all would be much appreciated.
I would simply create the object in my jade but I want the object to be formatted where each item is on its own line (for readability), and jade doesn't currently support that.
On that link someone mentioned a solution that I did not understand at all: "so I accomplished what I wanted by passing in the array in grunt-contrib-jade instead of putting it directly in the template. Also allowed me to get rid of grunt-sed"
I am using codekit to compile my jade into static html, not Node.JS.