Menu icon Foundation
Handlebars template with Foundation for Sites 6.x?

Hi,

How can I add a Handlebars template that gets pre-compiled/processed/expanded during npm start build time?

There are NO examples anywhere that I can find.

Hi,

How can I add a Handlebars template that gets pre-compiled/processed/expanded during npm start build time? There are no examples anywhere that I can find. As a test, I've added this to src/pages/index.html. After building and loading index.html into a browser, the code is rendered as-is ... no evaluation was done.

Help!

var source = '<div>hello, {{firstName}} {{lastName}}!</div>';
var template = Handlebars.compile(source);
template({firstName: "Alan", lastName: "Johnson"});

Handlebarsfoundation 6moustachetemplating

Hi,

How can I add a Handlebars template that gets pre-compiled/processed/expanded during npm start build time?

There are NO examples anywhere that I can find.

Hi,

How can I add a Handlebars template that gets pre-compiled/processed/expanded during npm start build time? There are no examples anywhere that I can find. As a test, I've added this to src/pages/index.html. After building and loading index.html into a browser, the code is rendered as-is ... no evaluation was done.

Help!

var source = '<div>hello, {{firstName}} {{lastName}}!</div>';
var template = Handlebars.compile(source);
template({firstName: "Alan", lastName: "Johnson"});
Rafi Benkual over 3 years ago

If you use the ZURB stack from the CLI this functionality is built in. More details here: http://foundation.zurb.com/sites/docs/starter-projects.html

E. Smythe over 3 years ago

Rafi, thanks for the reply, but that doesn't help. Did you read my post? I wrote: "As a test, I've added this to src/pages/index.html. After building and loading index.html into a browser, the code is rendered as-is ... no evaluation was done."

So, what am I doing wrong?