mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 10:21:36 +03:00
64626dedd1
refs #9178 - not 100% sure about this, but i think it makes right now the most sense - we have already a url service and creating another lib/url is confusing at the moment - i'll copy the last utility `makeAbsoluteUrls` to the url service for now - see next commit for explanation (!)
10 lines
381 B
JavaScript
10 lines
381 B
JavaScript
module.exports.twitter = function twitter(username) {
|
|
// Creates the canonical twitter URL without the '@'
|
|
return 'https://twitter.com/' + username.replace(/^@/, '');
|
|
};
|
|
|
|
module.exports.facebook = function facebook(username) {
|
|
// Handles a starting slash, this shouldn't happen, but just in case
|
|
return 'https://www.facebook.com/' + username.replace(/^\//, '');
|
|
};
|