Ghost/core/frontend/meta/amp-url.js
Hannah Wolfe af4bfb8862
Changed meta filenames to correct casing
- purely for cleanliness!
- we use kebabcase by default
- tests should be kebab-case-file_spec.js (one day we want this to be .test.js)
2021-07-01 12:30:25 +01:00

15 lines
418 B
JavaScript

const urlUtils = require('../../shared/url-utils');
const getUrl = require('./url');
const _ = require('lodash');
function getAmplUrl(data) {
const context = data.context ? data.context : null;
if (_.includes(context, 'post') && !_.includes(context, 'amp')) {
return urlUtils.urlJoin(urlUtils.urlFor('home', true), getUrl(data, false), 'amp/');
}
return null;
}
module.exports = getAmplUrl;