mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 05:50:35 +03:00
Merge pull request #3413 from halfdan/3407-meta-title
Correct meta_title for author pages.
This commit is contained in:
commit
6628127297
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user