diff --git a/ghost/core/core/frontend/helpers/comments.js b/ghost/core/core/frontend/helpers/comments.js index c48a0869d7..7fe3a9c3a2 100644 --- a/ghost/core/core/frontend/helpers/comments.js +++ b/ghost/core/core/frontend/helpers/comments.js @@ -24,13 +24,24 @@ async function comments(options) { } let colorScheme = 'auto'; - if (options.hash.color_scheme === 'dark' || options.hash.color_scheme === 'light') { - colorScheme = options.hash.color_scheme; + if (options.hash.mode === 'dark' || options.hash.mode === 'light') { + colorScheme = options.hash.mode; } - let avatarSaturation = parseInt(options.hash.avatar_saturation); + let avatarSaturation = parseInt(options.hash.saturation); if (isNaN(avatarSaturation)) { - avatarSaturation = 50; + avatarSaturation = 60; + } + + let count = true; + if (options.hash.count === false) { + count = false; + } + + // This is null so that the comments-ui can handle the default title + let title = null; + if (typeof options.hash.title === 'string') { + title = options.hash.title; } let accentColor = ''; @@ -47,6 +58,8 @@ async function comments(options) { admin: urlUtils.urlFor('admin', true), key: frontendKey, styles: stylesUrl, + title: title, + count: count, 'post-id': this.id, 'sentry-dsn': '', /* todo: insert sentry dsn key here */ 'color-scheme': colorScheme, diff --git a/ghost/core/test/unit/frontend/helpers/comments.test.js b/ghost/core/test/unit/frontend/helpers/comments.test.js index d7cc909a32..c7aa50c2ec 100644 --- a/ghost/core/test/unit/frontend/helpers/comments.test.js +++ b/ghost/core/test/unit/frontend/helpers/comments.test.js @@ -57,7 +57,20 @@ describe('{{comments}} helper', function () { }); should.exist(rendered); rendered.string.should.containEql('