lib/render.js
function formDataFromLayout(locals, uri) {
  return function (result) {
    const _layoutRef = result.layout,
      pageData = references.omitPageConfiguration(result);

    return components.get(_layoutRef, locals)
      .then(layout => mapLayoutToPageData(pageData, layout))
      .then(mappedData => module.exports.formDataForRenderer(mappedData, { _layoutRef, _ref: uri }, locals));
  };
}
function formDataFromLayout(locals, uri) {
  return function (result) {
    const _layoutRef = result.layout,
      pageData = references.omitPageConfiguration(result);

    return components.get(_layoutRef, locals)
      .then(layout => mapLayoutToPageData(pageData, layout))
      .then(mappedData => module.exports.formDataForRenderer(mappedData, { _layoutRef, _ref: uri }, locals));
  };
}
function formDataFromLayout ( locals , uri ) { return function ( result ) { const _layoutRef = result . layout , pageData = references . omitPageConfiguration ( result ) ; return components . get ( _layoutRef , locals ) . then ( layout => mapLayoutToPageData ( pageData , layout ) ) . then ( mappedData => module . exports . formDataForRenderer ( mappedData , { _layoutRef , _ref : uri } , locals ) ) ; } ; }
Given a page uri, get it from the db, resolve the layout,
map page data to the page ares and then format all the
data for the renderer

@param  {Object} locals
@param  {String} uri
@return {Function<Promise>}
Given a page uri get it from the db resolve the layout map page data to the page ares and then format all the data for the renderer