mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-30 21:40:39 +03:00
Rename classes applied to {{bodyclass}} to be less generic
This commit is contained in:
parent
9d8bf4b0f9
commit
8ac173aa19
@ -106,9 +106,9 @@ coreHelpers = function (ghost) {
|
|||||||
ghost.registerThemeHelper('bodyclass', function (options) {
|
ghost.registerThemeHelper('bodyclass', function (options) {
|
||||||
var classes = [];
|
var classes = [];
|
||||||
if (!this.path || this.path === '/' || this.path === '') {
|
if (!this.path || this.path === '/' || this.path === '') {
|
||||||
classes.push('home');
|
classes.push('home-template');
|
||||||
} else {
|
} else {
|
||||||
classes.push('post');
|
classes.push('post-template');
|
||||||
}
|
}
|
||||||
|
|
||||||
return ghost.doFilter('bodyclass', classes, function (classes) {
|
return ghost.doFilter('bodyclass', classes, function (classes) {
|
||||||
|
@ -149,7 +149,7 @@ describe('Core Helpers', function () {
|
|||||||
var rendered = handlebars.helpers.bodyclass.call({});
|
var rendered = handlebars.helpers.bodyclass.call({});
|
||||||
should.exist(rendered);
|
should.exist(rendered);
|
||||||
|
|
||||||
rendered.string.should.equal('home');
|
rendered.string.should.equal('home-template');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('can render class string for context', function () {
|
it('can render class string for context', function () {
|
||||||
@ -159,8 +159,8 @@ describe('Core Helpers', function () {
|
|||||||
should.exist(rendered1);
|
should.exist(rendered1);
|
||||||
should.exist(rendered2);
|
should.exist(rendered2);
|
||||||
|
|
||||||
rendered1.string.should.equal('home');
|
rendered1.string.should.equal('home-template');
|
||||||
rendered2.string.should.equal('post');
|
rendered2.string.should.equal('post-template');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user