mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-29 13:52:10 +03:00
Renamed sodo search identification attribute
refs https://github.com/TryGhost/Team/issues/1665 - The search script should be uniquiely identifiable in DOM. Previously element for portal scipt element and search element both had `data-ghost` attributes` for identification. Having `data-sodo-search` makes naming unique
This commit is contained in:
parent
f6b2a83761
commit
b996eadbd4
@ -62,7 +62,7 @@ function getSearchHelper(frontendKey) {
|
||||
return '';
|
||||
}
|
||||
|
||||
let helper = `<script defer src="${config.get('sodoSearch:url')}" data-ghost="${urlUtils.getSiteUrl()}" data-key="${frontendKey}" data-api="${urlUtils.urlFor('api', {type: 'content'}, true)}" crossorigin="anonymous"></script>`;
|
||||
let helper = `<script defer src="${config.get('sodoSearch:url')}" data-sodo-search="${urlUtils.getSiteUrl()}" data-key="${frontendKey}" data-api="${urlUtils.urlFor('api', {type: 'content'}, true)}" crossorigin="anonymous"></script>`;
|
||||
|
||||
return helper;
|
||||
}
|
||||
|
@ -1739,7 +1739,7 @@ describe('{{ghost_head}} helper', function () {
|
||||
|
||||
describe('search scripts', function () {
|
||||
it('includes search when labs flag enabled', function (done) {
|
||||
labsStub = sinon.stub(labs, 'isSet').returns(true);
|
||||
sinon.stub(labs, 'isSet').returns(true);
|
||||
|
||||
ghost_head(testUtils.createHbsResponse({
|
||||
locals: {
|
||||
@ -1750,7 +1750,7 @@ describe('{{ghost_head}} helper', function () {
|
||||
})).then(function (rendered) {
|
||||
should.exist(rendered);
|
||||
rendered.string.should.containEql('<script defer src="https://unpkg.com/@tryghost/sodo-search');
|
||||
rendered.string.should.containEql('data-ghost="http://127.0.0.1:2369/" data-key="xyz" data-api="http://127.0.0.1:2369/ghost/api/content/"');
|
||||
rendered.string.should.containEql('data-sodo-search="http://127.0.0.1:2369/" data-key="xyz" data-api="http://127.0.0.1:2369/ghost/api/content/"');
|
||||
|
||||
done();
|
||||
}).catch(done);
|
||||
|
Loading…
Reference in New Issue
Block a user