Ghost/core/server/data/meta/amp_url.js
Katharina Irrgang 16f5d1fdaf 🎨 add urlFor('admin') and increase usage of urlFor helper (#7935)
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)
2017-02-02 18:51:35 +00:00

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;