mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-30 14:22:07 +03:00
a9050f68ea
no issue - Removed deprecated 'blog' reference from frontend data. The alias (site->blog) stays till next version (v4) as it's not leaving much of technical debt but would ease the migration process for anybody still using it. - The follow up to this is substitute of all references to `options.data.blog` with `options.data.site` in "frontend" - Fixed test utils helper to use `site` instead of `blog` - Removed 0.1 flag checks in {{get}} helper - Removed user aliasing from {{get}} helper - Removed unused translation for {{get}} helper - Added a note to excerpt changes in metadata for future reference - Removed page alias used in description helper. The mix of page context with post object in the metadata was only possible in v0.1 - Changed mock in ghost_head helper to use v2 - Removed unneeded test for body class helper
22 lines
615 B
JavaScript
22 lines
615 B
JavaScript
// # Twitter URL Helper
|
|
// Usage: `{{twitter_url}}` or `{{twitter_url author.twitter}}`
|
|
//
|
|
// Output a url for a twitter username
|
|
var proxy = require('./proxy'),
|
|
socialUrls = proxy.socialUrls,
|
|
localUtils = proxy.localUtils;
|
|
|
|
// We use the name twitter_url to match the helper for consistency:
|
|
module.exports = function twitter_url(username, options) { // eslint-disable-line camelcase
|
|
if (!options) {
|
|
options = username;
|
|
username = localUtils.findKey('twitter', this, options.data.site);
|
|
}
|
|
|
|
if (username) {
|
|
return socialUrls.twitter(username);
|
|
}
|
|
|
|
return null;
|
|
};
|