mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 02:11:44 +03:00
06061d5d6c
refs #7666 Use urlJoin for more consistency instead of concatenating url strings.
15 lines
401 B
JavaScript
15 lines
401 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;
|