What you are looking for is a templating engine, since you mentioned the {{ }}tags I am assuming you are using Hogan.js aka moustache(the javascript version).
The documentation can be found here and what you are specifically looking for is the partials section.
Please note, the default express app(if you select hogan) comes installed with the hjs module which does not support partials, you will need to install the hogan-express module and replace them.
A partial looks like so:
{{> head}}
index
</body>
</html>
Partials are sent from a get or post object like so:
What you are looking for is a templating engine, since you mentioned the
{{ }}
tags I am assuming you are usingHogan.js
aka moustache(the javascript version).The documentation can be found here and what you are specifically looking for is the partials section.
Please note, the default express app(if you select hogan) comes installed with the hjs module which does not support partials, you will need to install the hogan-express module and replace them.
A partial looks like so:
Partials are sent from a get or post object like so:
I found the solution. server.js
index.html Index.html includes head.html like this:
If you do not want to use ejs or jade etc then you could do it with jquery. Put this code in index.html
You are looking for a template engine for nodejs?
For example check here: http://node-modules.com/search?q=template+engine