mbanting / metalsmith-prismic

A Metalsmith.io plugin to pull in content from Prismic.io
MIT License
48 stars 19 forks source link

"results" doesn't get added to the file's metadata #18

Closed erwan closed 9 years ago

erwan commented 9 years ago

Hi,

I'm trying the plugin but I can't get the content from to the template. I've added some logs and it appears that the content is correctly fetched, but it doesn't get added to the file metadata. When I inspect it, I only get the variables I've put but "results" is not present.

Any idea what's going on? Maybe you have a working example somewhere with the source available?

The code is here:

https://github.com/erwan/lemmonjp/blob/metalsmith/src/index.md

https://github.com/erwan/lemmonjp/blob/metalsmith/src/index.md

galeksic90 commented 9 years ago

Try to remove .cdn from your api url.

"metalsmith-prismic": {
      "url": "https://lemmonjp.cdn.prismic.io/api"
    }
erwan commented 9 years ago

It doesn't change anything.

erwan commented 9 years ago

Apparently it was because I put prismic-plugin after the template plugin in metalsmith.json, and the order matters.

mbanting commented 9 years ago

Hi @erwan sorry I didn't respond earlier. Long wknd here in Canada and I unplugged for a little bit. Glad you figured it out.