Skip to content

Commit 87ff067

Browse files
committed
Fix docsearch global
1 parent 895f971 commit 87ff067

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/layouts/index.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const SEARCH_DOCS = true;
1616
let docsearch;
1717
if (typeof window !== "undefined" && SEARCH_DOCS) {
1818
docsearch = require("docsearch.js/dist/cdn/docsearch.min");
19+
window.docsearch = docsearch;
1920
} else {
2021
docsearch = false;
2122
}
@@ -342,6 +343,19 @@ class Header extends React.Component {
342343
content: "{% endraw %}";
343344
}
344345
`}</style>
346+
<script
347+
type="text/javascript"
348+
dangerouslySetInnerHTML={{
349+
__html: `
350+
docsearch({
351+
apiKey: "4b6d0afa80197db35886555b5ef4721f",
352+
inputSelector: "#search-docs",
353+
indexName: "graphene_python",
354+
debug: false
355+
});
356+
`
357+
}}
358+
/>
345359
</div>
346360
);
347361
}

0 commit comments

Comments
 (0)