0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00
ghost/core/server/helpers/facebook_url.js
Katharina Irrgang 4f35f86713
Moved word-count utility to helpers/utils.js (#9328)
refs #9178

- each package/module has a local utility (e.g. api, helpers, adapters)
- these are very small utility functions which are only used from this package
- they don't belong into the global lib/utils
2017-12-13 14:05:53 +01:00

21 lines
626 B
JavaScript

// # Facebook URL Helper
// Usage: `{{facebook_url}}` or `{{facebook_url author.facebook}}`
//
// Output a url for a twitter username
var proxy = require('./proxy'),
socialUrls = proxy.socialUrls,
localUtils = proxy.localUtils;
// We use the name facebook_url to match the helper for consistency:
module.exports = function facebook_url(username, options) { // eslint-disable-line camelcase
if (!options) {
options = username;
username = localUtils.findKey('facebook', this, options.data.blog);
}
if (username) {
return socialUrls.facebookUrl(username);
}
return null;
};