From ef7151ca3f24cf1bdd560e829d525c344acd7b14 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 --- app/helpers/author-names.js | 12 ++++++++++++ app/templates/components/gh-post-settings-menu.hbs | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 app/helpers/author-names.js diff --git a/app/helpers/author-names.js b/app/helpers/author-names.js new file mode 100644 index 000000000..683ab5cc3 --- /dev/null +++ b/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/app/templates/components/gh-post-settings-menu.hbs b/app/templates/components/gh-post-settings-menu.hbs index 2c142168e..b928c4886 100644 --- a/app/templates/components/gh-post-settings-menu.hbs +++ b/app/templates/components/gh-post-settings-menu.hbs @@ -347,7 +347,7 @@
{{truncate facebookDescription 300}}