mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-19 16:42:17 +03:00
35e3e0708c
- The proxy is not a helper, we want the helpers folder to only include helpers - The proxy is also meant to be the interface to Ghost for the helpers, and we want to enforce that - This is a small step on the way
20 lines
585 B
JavaScript
20 lines
585 B
JavaScript
// # Facebook URL Helper
|
|
// Usage: `{{facebook_url}}` or `{{facebook_url author.facebook}}`
|
|
//
|
|
// Output a url for a facebook username
|
|
const {socialUrls, localUtils} = require('../services/proxy');
|
|
|
|
// 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.site);
|
|
}
|
|
|
|
if (username) {
|
|
return socialUrls.facebook(username);
|
|
}
|
|
|
|
return null;
|
|
};
|