lib/services/publish.js
function publishPageAtUrl(url, uri, data, locals, site) { // eslint-disable-line
  if (data._dynamic) {
    locals.isDynamicPublishUrl = true;
    return data;
  }

  // set the publishUrl for component's model.js files that
  // may want to know about the URL of the page
  locals.publishUrl = url;

  return bluebird.resolve({ url })
    .then(metaObj => storeUrlHistory(metaObj, uri, url))
    .then(metaObj => addRedirects(metaObj, uri))
    .then(metaObj => addToMeta(metaObj, site.assignToMetaOnPublish, uri, data));
}
function publishPageAtUrl(url, uri, data, locals, site) { // eslint-disable-line
  if (data._dynamic) {
    locals.isDynamicPublishUrl = true;
    return data;
  }

  // set the publishUrl for component's model.js files that
  // may want to know about the URL of the page
  locals.publishUrl = url;

  return bluebird.resolve({ url })
    .then(metaObj => storeUrlHistory(metaObj, uri, url))
    .then(metaObj => addRedirects(metaObj, uri))
    .then(metaObj => addToMeta(metaObj, site.assignToMetaOnPublish, uri, data));
}
function publishPageAtUrl ( url , uri , data , locals , site ) { // eslint-disable-line if ( data . _dynamic ) { locals . isDynamicPublishUrl = true ; return data ; } // set the publishUrl for component's model.js files that // may want to know about the URL of the page locals . publishUrl = url ; return bluebird . resolve ( { url } ) . then ( metaObj => storeUrlHistory ( metaObj , uri , url ) ) . then ( metaObj => addRedirects ( metaObj , uri ) ) . then ( metaObj => addToMeta ( metaObj , site . assignToMetaOnPublish , uri , data ) ) ; }
Always do these actions when publishing a page

@param {String} url
@param {String} uri
@param {Object} data
@param {Object} locals
@param {Object} site
@return {Promise}
Always do these actions when publishing a page