I am trying to use Metalsmith to render content from the Contentful platform (using the metalsmith-contentful platform and metalsmith-layout as per the example here).
One of my contentful fields is markdown text, so I want to render it as HTML in the final template. My initial setup was similar to the example above but only read the markdown text as plain text.
I am now trying to convert the markdown in a handlebars helper, i.e.
handlebars.registerHelper('markdown', function(object) {
var text = marked(object);
return new handlebars.SafeString(text);
})
and calling with {{{ markdown mycontentfulobject}}}
but this doesn't work either.
Any ideas?