mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-19 08:31:43 +03:00
c8119eee1f
refs #6982
16 lines
414 B
JavaScript
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;
|