🐛 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
This commit is contained in:
Kevin Ansfield 2019-03-12 12:14:54 +00:00
parent 334eb4e6ab
commit ef7151ca3f
2 changed files with 13 additions and 1 deletions

View File

@ -0,0 +1,12 @@
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);

View File

@ -347,7 +347,7 @@
<div class="gh-og-preview-description">{{truncate facebookDescription 300}}</div>
<div class="gh-og-preview-footer">
<div class="gh-og-preview-footer-left">
{{config.blogDomain}} <span class="gh-og-preview-footer-left-divider">|</span> by <span class="gh-og-preview-footer-author">{{post.author.name}}</span>
{{config.blogDomain}} <span class="gh-og-preview-footer-left-divider">|</span> by <span class="gh-og-preview-footer-author">{{author-names post.authors}}</span>
</div>
<div class="gh-og-preview-footer-right">
</div>