mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 02:11:44 +03:00
16f5d1fdaf
refs #7488 - to be able to refactor the url configuration in ghost, we need to go step by step making this possible - reduce the usage of forceAdminSSL - add a urlFor('admin') helper, which returns the admin url + path e.g. http://my-blog.com/blog/ghost - increase usage of urlFor helper - do not expose getBaseUrl, use urlFor('home') (home === blog)
15 lines
404 B
JavaScript
15 lines
404 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.urlFor('home', true), getUrl(data, false), 'amp/');
|
|
}
|
|
return null;
|
|
}
|
|
|
|
module.exports = getAmplUrl;
|