diff --git a/core/frontend/helpers/ghost_head.js b/core/frontend/helpers/ghost_head.js index bdff4146e4..c95eb5191a 100644 --- a/core/frontend/helpers/ghost_head.js +++ b/core/frontend/helpers/ghost_head.js @@ -173,8 +173,8 @@ module.exports = function ghost_head(options) { // eslint-disable-line camelcase } } - if (settingsCache.get('accent_color')) { - const accentColor = escapeExpression(settingsCache.get('accent_color')); + if (options.data.site.accent_color) { + const accentColor = escapeExpression(options.data.site.accent_color); const styleTag = ``; const existingScriptIndex = _.findLastIndex(head, str => str.match(/<\/(style|script)>/)); diff --git a/test/unit/helpers/ghost_head_spec.js b/test/unit/helpers/ghost_head_spec.js index b72b15c684..467570c29e 100644 --- a/test/unit/helpers/ghost_head_spec.js +++ b/test/unit/helpers/ghost_head_spec.js @@ -1555,13 +1555,18 @@ describe('{{ghost_head}} helper', function () { describe('accent_color', function () { it('includes style tag when set', function (done) { - settingsCache.get.withArgs('accent_color').returns('#123456'); - const renderObject = { post: posts[1] }; + const templateOptions = { + site: { + accent_color: '#123456' + } + }; + helpers.ghost_head(testUtils.createHbsResponse({ + templateOptions, renderObject: renderObject, locals: { relativeUrl: '/post/', @@ -1576,13 +1581,18 @@ describe('{{ghost_head}} helper', function () { }); it('does not include style tag when not set', function (done) { - settingsCache.get.withArgs('accent_color').returns(null); - const renderObject = { post: posts[1] }; + const templateOptions = { + site: { + accent_color: null + } + }; + helpers.ghost_head(testUtils.createHbsResponse({ + templateOptions, renderObject: renderObject, locals: { relativeUrl: '/post/', @@ -1597,13 +1607,18 @@ describe('{{ghost_head}} helper', function () { }); it('attaches style tag to existing script/style tag', function (done) { - settingsCache.get.withArgs('accent_color').returns('#123456'); - const renderObject = { post: posts[1] }; + const templateOptions = { + site: { + accent_color: '#123456' + } + }; + helpers.ghost_head(testUtils.createHbsResponse({ + templateOptions, renderObject: renderObject, locals: { relativeUrl: '/post/',