Ghost/core/server/lib/social/urls.js
kirrg001 64626dedd1 Moved social utility to lib/social
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 (!)
2017-12-14 22:34:05 +01:00

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(/^\//, '');
};