efd1587ee9
refs #9834 - @TODO: the test env eslint needs to use the plugin, not part of this PR
15 lines
424 B
JavaScript
15 lines
424 B
JavaScript
var urlService = require('../../services/url'),
|
|
getUrl = require('./url'),
|
|
_ = require('lodash');
|
|
|
|
function getAmplUrl(data) {
|
|
var context = data.context ? data.context : null;
|
|
|
|
if (_.includes(context, 'post') && !_.includes(context, 'amp')) {
|
|
return urlService.utils.urlJoin(urlService.utils.urlFor('home', true), getUrl(data, false), 'amp/');
|
|
}
|
|
return null;
|
|
}
|
|
|
|
module.exports = getAmplUrl;
|