mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-23 10:53:34 +03:00
🐛 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:
parent
c28d024fec
commit
59d7651ef0
12
ghost/admin/app/helpers/author-names.js
Normal file
12
ghost/admin/app/helpers/author-names.js
Normal 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);
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user