0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-27 22:49:56 -05:00
ghost/core/server/data/meta/amp_url.js
2016-09-20 15:59:34 +01:00

15 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;