mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 11:55:03 +03:00
Merge pull request #2329 from stenehall/master
Fix for #2328 - Added check for tag for title
This commit is contained in:
commit
a11acff4fd
@ -461,11 +461,13 @@ coreHelpers.meta_title = function (options) {
|
||||
blog;
|
||||
|
||||
if (_.isString(this.relativeUrl)) {
|
||||
blog = config.theme();
|
||||
if (!this.relativeUrl || this.relativeUrl === '/' || this.relativeUrl === '' || this.relativeUrl.match(/\/page/)) {
|
||||
blog = config.theme();
|
||||
title = blog.title;
|
||||
} else if (this.post) {
|
||||
title = this.post.title;
|
||||
} else if (this.tag) {
|
||||
title = this.tag.name + ' - ' + blog.title;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -865,6 +865,16 @@ describe('Core Helpers', function () {
|
||||
done();
|
||||
}).then(null, done);
|
||||
});
|
||||
|
||||
it('can return tag name', function (done) {
|
||||
var post = {relativeUrl: '/tag/foo', tag: {name: 'foo'}};
|
||||
helpers.meta_title.call(post).then(function (rendered) {
|
||||
should.exist(rendered);
|
||||
rendered.string.should.equal('foo - Ghost');
|
||||
|
||||
done();
|
||||
}).then(null, done);
|
||||
});
|
||||
});
|
||||
|
||||
describe("meta_description helper", function () {
|
||||
|
Loading…
Reference in New Issue
Block a user