Skip to content

Instantly share code, notes, and snippets.

@eyy
Created September 11, 2013 18:34
Show Gist options
  • Save eyy/6527837 to your computer and use it in GitHub Desktop.
Save eyy/6527837 to your computer and use it in GitHub Desktop.
dust.js helper: first item
dust.helpers.first = function(chunk, context, bodies) {
if (context.stack.index == 0)
return chunk.render(bodies.block, context);
else if (bodies['else'])
return chunk.render(bodies['else'], context);
else
return chunk;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment