Ghost/core/server/data/meta/amp_url.js
Aileen Nowak 06061d5d6c 💄 Improve URL consistency, Part 1: urlJoin (#7668)
refs #7666

Use urlJoin for more consistency instead of concatenating url strings.
2016-11-14 14:38:55 +00:00

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;