carrot / sprout-static-cms

A sprout template for building a static CMS with Roots, Contentful, and Netlify.
Other
53 stars 10 forks source link

sprout-static-cms requires update? #8

Open hamish opened 8 years ago

hamish commented 8 years ago

Hi,

I attempted to run the init script, but came across some errors.

$ sprout add static-cms https://github.com/carrot/sprout-static-cms.git
✓ template `static-cms` from https://github.com/carrot/sprout-static-cms.git added!
$ sprout list
- static-cms
$ sprout init static-cms my-static-site
✘ Error: init.js does not exist in this template

Looking at sprout - I noticed that there was a large refactor that removed coffeescript in March. https://github.com/carrot/sprout/issues/144

I forked the project, compiled all of the coffee files to js, and was able to use init the project and run the generator, but when I attempted to generate a page I got an error:

Potentially unhandled rejection [33] TypeError: /Users/hamish/dev/hotcurrie/my-blog/views/index.jade:5
    3| block content
    4|   ul
  > 5|     - for post in contentful.posts
    6|       li
    7|         h4= post.title
    8|         img(src= asset(post.image))

Cannot read property 'posts' of undefined

Can you suggest any changes required to make this template work with recent versions of sprout?

thanks

kylemac commented 8 years ago

you're right @hamish it does require an update. this template still is in the pre v1.0.0 syntax. to get it working you'll have to npm i sprout-cli@0.0.2 -g -- that version should work properly for ya