From 59d7651ef0ac2c85795e3da7ed8c0e45728b34d6 Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Tue, 12 Mar 2019 12:14:54 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fixed=20author=20names=20not=20a?= =?UTF-8?q?ppearing=20in=20Facebook=20open-graph=20preview?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit no issue - added an `{{author-names}}` helper that takes an array of author-like objects and returns their names separated by a comma --- ghost/admin/app/helpers/author-names.js | 12 ++++++++++++ .../templates/components/gh-post-settings-menu.hbs | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 ghost/admin/app/helpers/author-names.js diff --git a/ghost/admin/app/helpers/author-names.js b/ghost/admin/app/helpers/author-names.js new file mode 100644 index 0000000000..683ab5cc36 --- /dev/null +++ b/ghost/admin/app/helpers/author-names.js @@ -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); diff --git a/ghost/admin/app/templates/components/gh-post-settings-menu.hbs b/ghost/admin/app/templates/components/gh-post-settings-menu.hbs index 2c142168eb..b928c48868 100644 --- a/ghost/admin/app/templates/components/gh-post-settings-menu.hbs +++ b/ghost/admin/app/templates/components/gh-post-settings-menu.hbs @@ -347,7 +347,7 @@
{{truncate facebookDescription 300}}