mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05:00
16 lines
409 B
JavaScript
16 lines
409 B
JavaScript
|
var config = require('../../config'),
|
||
|
getUrl = require('./url'),
|
||
|
_ = require('lodash');
|
||
|
|
||
|
function getAmplUrl(data) {
|
||
|
var context = data.context ? data.context : null;
|
||
|
|
||
|
if (_.includes(context, 'post') && !_.includes(context, 'amp')) {
|
||
|
return config.urlJoin(config.getBaseUrl(false),
|
||
|
getUrl(data, false)) + 'amp/';
|
||
|
}
|
||
|
return null;
|
||
|
}
|
||
|
|
||
|
module.exports = getAmplUrl;
|