     constructor: (@roots) ->
       @util = new RootsUtil(@roots)
       @roots.config.locals ?= {}
+      @roots.config.locals.contentful ?= {}
 
     setup: ->
-      configure_content(opts.content_types)
-        .then(get_all_content.bind(@))
-        .then (res) => @roots.config.locals.contentful = res
+      configure_content(opts.content_types).with(@)
+        .then(get_all_content)
+        .tap(set_locals)
+        .tap(compile_entries)
 
     ###*
      * Configures content types set in app.coffee. Sets default values if

      _.assign(_.omit(e, 'fields'), e.fields)

    ###*
     * Compiles single entry views if a template is given for the content type
     * @param {Object} type - Type configuration object
     * @param {Array} content - Formatted entries for the type from Contentful
     * @return {Promise} - promise for when compilation is finished
    ###

    compile_entries = (type, content) ->
      if not type.template then return W.resolve()
      W.map content, (entry) =>
        locals = _.merge(@roots.config.locals, entry: entry)
        jade.renderFile(path.join(@roots.root, type.template), locals)
          .then((res) => @util.write("#{type.path(entry)}.html", res))

    ###

    get_all_content = (types) ->
      W.map types, (t) =>
        fetch_content(t)
          .then(format_content)
          .then((c) -> t.content = c)
          .yield(t)

    ###*
     * Fetch entries for a single content type object
