mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-21 09:52:06 +03:00
c8119eee1f
refs #6982
15 lines
330 B
JavaScript
15 lines
330 B
JavaScript
var utils = require('../../utils'),
|
|
getUrl = require('./url');
|
|
|
|
function getCanonicalUrl(data) {
|
|
var url = utils.url.urlJoin(utils.url.getBaseUrl(false),
|
|
getUrl(data, false));
|
|
|
|
if (url.indexOf('/amp/')) {
|
|
url = url.replace(/\/amp\/$/i, '/');
|
|
}
|
|
return url;
|
|
}
|
|
|
|
module.exports = getCanonicalUrl;
|