diff --git a/core/server/helpers/index.js b/core/server/helpers/index.js index 00472f0f27..94dd893db4 100644 --- a/core/server/helpers/index.js +++ b/core/server/helpers/index.js @@ -510,6 +510,8 @@ coreHelpers.meta_title = function (options) { title = this.post.title; } else if (this.tag) { title = this.tag.name + ' - ' + blog.title; + } else if (this.author) { + title = this.author.name + ' - ' + blog.title; } } diff --git a/core/test/unit/server_helpers_index_spec.js b/core/test/unit/server_helpers_index_spec.js index 7161a596b0..34b8951965 100644 --- a/core/test/unit/server_helpers_index_spec.js +++ b/core/test/unit/server_helpers_index_spec.js @@ -923,6 +923,26 @@ describe('Core Helpers', function () { }).then(null, done); }); + it('can return title for a tag page', function (done) { + var tag = {relativeUrl: '/tag/rasper-red', tag: {name: 'Rasper Red'}}; + helpers.meta_title.call(tag).then(function (rendered) { + should.exist(rendered); + String(rendered).should.equal('Rasper Red - Ghost'); + + done(); + }).then(null, done); + }); + + it('can return title for an author page', function (done) { + var author = {relativeUrl: '/author/donald', author: {name: 'Donald Duck'}}; + helpers.meta_title.call(author).then(function (rendered) { + should.exist(rendered); + String(rendered).should.equal('Donald Duck - Ghost'); + + done(); + }).then(null, done); + }); + it('can return escaped title of a post', function (done) { var post = {relativeUrl: '/nice-escaped-post', post: {title: 'Post Title "'}}; helpers.meta_title.call(post).then(function (rendered) {