mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-03 16:38:22 +03:00
🐛 Fixed incorrect html title appearing on 'pages' pages (#11358)
closes #11357
- Change that introduced a bug was made in cbca480b97
- The condition could be removed once https://github.com/TryGhost/Ghost/issues/10042 is resolved. It is currently not dependent on the API version rather the object form used in the frontend.
This commit is contained in:
parent
9a2719ac4f
commit
3f88e7de63
@ -47,6 +47,14 @@ function getTitle(data, root, options) {
|
||||
} else {
|
||||
title = data.post.meta_title || data.post.title;
|
||||
}
|
||||
// Page title dependent on legacy object formatting (https://github.com/TryGhost/Ghost/issues/10042)
|
||||
} else if (_.includes(context, 'page') && data.post) {
|
||||
if (options && options.property) {
|
||||
postSdTitle = options.property + '_title';
|
||||
title = data.post[postSdTitle] || '';
|
||||
} else {
|
||||
title = data.post.meta_title || data.post.title;
|
||||
}
|
||||
// Page title v2
|
||||
} else if (_.includes(context, 'page') && data.page) {
|
||||
if (options && options.property) {
|
||||
|
@ -351,7 +351,7 @@ describe('Frontend Routing', function () {
|
||||
should.not.exist(res.headers['set-cookie']);
|
||||
should.exist(res.headers.date);
|
||||
|
||||
$('title').text().should.equal('Ghost');
|
||||
$('title').text().should.equal('This is static page');
|
||||
$('body.page-template').length.should.equal(1);
|
||||
$('article.post').length.should.equal(1);
|
||||
|
||||
|
@ -61,7 +61,7 @@ describe('{{meta_title}} helper', function () {
|
||||
|
||||
it('returns correct title for a page with meta_title set', function () {
|
||||
var rendered = helpers.meta_title.call(
|
||||
{page: {title: 'About Page', meta_title: 'All about my awesomeness', page: true}},
|
||||
{post: {title: 'About Page', meta_title: 'All about my awesomeness', page: true}},
|
||||
{data: {root: {context: ['page']}}}
|
||||
);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user