diff --git a/core/ghost.js b/core/ghost.js index adcea706d71..0c72de771da 100644 --- a/core/ghost.js +++ b/core/ghost.js @@ -301,10 +301,9 @@ Ghost.prototype.initTheme = function (app) { app.set('views', self.paths().adminViews); app.use('/public', express['static'](path.join(__dirname, '/client/assets'))); app.use('/public', express['static'](path.join(__dirname, '/client'))); - app.use('/shared', express['static'](path.join(__dirname, '/shared/'))); - } app.use(express['static'](self.paths().activeTheme)); + app.use('/shared', express['static'](path.join(__dirname, '/shared'))); app.use('/content/images', express['static'](path.join(__dirname, '/../content/images'))); next(); }; diff --git a/core/server/helpers/index.js b/core/server/helpers/index.js index 3e57ecc089c..48b1aa5317c 100644 --- a/core/server/helpers/index.js +++ b/core/server/helpers/index.js @@ -127,7 +127,25 @@ coreHelpers = function (ghost) { }); }); + ghost.registerThemeHelper('ghost_head', function (options) { + var head = []; + head.push(''); + return ghost.doFilter('ghost_head', head, function (head) { + var headString = _.reduce(head, function (memo, item) { return memo + ' ' + item; }, ''); + return new hbs.handlebars.SafeString(headString.trim()); + }); + }); + + ghost.registerThemeHelper('ghost_foot', function (options) { + var foot = []; + foot.push(''); + + return ghost.doFilter('ghost_foot', foot, function (foot) { + var footString = _.reduce(foot, function (memo, item) { return memo + ' ' + item; }, ''); + return new hbs.handlebars.SafeString(footString.trim()); + }); + }); /** * [ description] * diff --git a/core/test/unit/frontend_helpers_index_spec.js b/core/test/unit/frontend_helpers_index_spec.js index 784e555f9a6..9f6f5459035 100644 --- a/core/test/unit/frontend_helpers_index_spec.js +++ b/core/test/unit/frontend_helpers_index_spec.js @@ -177,6 +177,30 @@ describe('Core Helpers', function () { }); }); + describe('ghost_head Helper', function () { + it('has loaded ghost_head helper', function () { + should.exist(handlebars.helpers.ghost_head); + }); + + it('returns meta tag string', function () { + var rendered = handlebars.helpers.ghost_head.call({version: "0.3"}); + should.exist(rendered); + rendered.string.should.equal(''); + }); + }); + + describe('ghost_foot Helper', function () { + it('has loaded ghost_foot helper', function () { + should.exist(handlebars.helpers.ghost_foot); + }); + + it('returns meta tag string', function () { + var rendered = handlebars.helpers.ghost_foot.call(); + should.exist(rendered); + rendered.string.should.equal(''); + }); + }); + describe('Navigation Helper', function () { it('has loaded nav helper', function () {