Ghost/core/server/data/meta/amp_url.js
2016-09-20 15:59:34 +01:00

16 lines
414 B
JavaScript

var utils = require('../../utils'),
getUrl = require('./url'),
_ = require('lodash');
function getAmplUrl(data) {
var context = data.context ? data.context : null;
if (_.includes(context, 'post') && !_.includes(context, 'amp')) {
return utils.url.urlJoin(utils.url.getBaseUrl(false),
getUrl(data, false)) + 'amp/';
}
return null;
}
module.exports = getAmplUrl;