sindresorhus / gulp-template

Render/precompile Lodash templates

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can I include a html file in other html file?

kamlekar opened this issue · comments

Suppose, I have index.html as well as header.html. The header.html is as follows:

<div class="header">
      <%= name %>
</div>

I want to include this header in index.html. I am thinking of something like this:

<div class="page">
       <%= _.template('header.html')({name: "New Header"}) %>
</div>

Note: This is not an issue but enhancement.

Nah, outside the scope of this plugin. This is strictly for compiling/precompiling Lodash/Underscore templates.

If you need more advanced things like includes/extends, see https://github.com/carlosl/gulp-nunjucks-render.

Thanks, that plugin seems to do the trick!! :)