jnordberg/wintersmith

Hooking into 'wintersmith build'

boedlen opened this issue · 2 comments

Is it possible to write a plugin that hooks into the 'wintersmith build' event?

I'd like to use a tool like www.contentful.com for managing my content, and generate *.md files just before the HTML is being generated.

I think what you are after is the generator plugins, those hook in to the process letting you asynchronously create content from any source and inject it to the tree before building or previewing

Hi @boedlen
I'm also receiving data from http://www.contentful.com/. Beside Products getting rendered from json Objects, I have normal Pages created in contentful which are exposed as Markdown.

I require lodash assinged to _ and marked assinged to md in my config and then in my jade file:

- var pages = contents['pages.json'].metadata.items
- var content = md(_.find(pages, function(a) { return a.fields.pageType == 'imprint'; }).fields.page);
  .primary-area
  |  !{content}

Which works fine.