       before_pass: (ctx) =>
         # once content is loaded, pass contentful data into locals
         promise.then (locals) =>
-          return if @roots.config.locals.contentful
+          if @roots.config.locals.contentful then return
           @roots.config.locals.contentful = locals


  configure_content = (types) ->
    W.map types, (t) ->
      if not t.id then throw new Error errors.no_type_id
      t.filters ?= {}
      if t.name then return W.resolve()
      return client.contentType(t.id).then (res) ->
        t.name = pluralize(S(res.name).toLowerCase().underscore().s)
        return t


  ###

  get_all_content = (types) ->
    W.reduce types, (m, t) ->
      fetch_content(t)
        .then(format_content)
        .then((c) -> m[t.name] = c)
        .yield(m)
    , {}

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