Skip to content

Instantly share code, notes, and snippets.

@jimmyhchan
Forked from seriousManual/intro.js
Last active January 2, 2016 13:19
Show Gist options
  • Save jimmyhchan/8309666 to your computer and use it in GitHub Desktop.
Save jimmyhchan/8309666 to your computer and use it in GitHub Desktop.
//whitespaces added for clarification
module.exports = (function(){
dust.register("intro",body_0);
function body_0(chk,ctx){
return chk.write("Hello ").reference(ctx._get(false, ["name"]),ctx,"h").write("!");
}
return body_0;
})();
var dust = require('dustjs-linkedin');
var templateName = 'intro';
// this adds intro to dust.cache
require('./' + templateName);
dust.render('intro', {name:'fooooo'}, function(error, result) {
console.log(result);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment