Ghost/ghost/admin/app/helpers/author-names.js
Kevin Ansfield 59d7651ef0 🐛 Fixed author names not appearing in Facebook open-graph preview
no issue
- added an `{{author-names}}` helper that takes an array of author-like objects and returns their names separated by a comma
2019-03-12 12:15:02 +00:00

13 lines
285 B
JavaScript

import {helper} from '@ember/component/helper';
import {isEmpty} from '@ember/utils';
export function authorNames([authors]/*, hash*/) {
if (!authors || isEmpty(authors)) {
return;
}
return authors.mapBy('name').join(', ');
}
export default helper(authorNames);