0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00

Fixed search script element detection

refs https://github.com/TryGhost/Team/issues/1665

- The `data-ghost` attribute is used to detect portal script element. The search script will be identified by `data-ghost-search` data attribute (and probably so should the portal script in the futute)
This commit is contained in:
Naz 2022-07-04 15:58:11 +02:00
parent 76bc1a8c07
commit c55a641fa6

View file

@ -15,9 +15,9 @@ function getSiteData() {
/**
* @type {HTMLElement}
*/
const scriptTag = document.querySelector('script[data-ghost]');
const scriptTag = document.querySelector('script[data-ghost-search]');
if (scriptTag) {
const siteUrl = scriptTag.dataset.ghost;
const siteUrl = scriptTag.dataset.ghostSearch;
const apiKey = scriptTag.dataset.key;
const apiUrl = scriptTag.dataset.api;
return {siteUrl, apiKey, apiUrl};