Skip to content

Commit c868abe

Browse files
committed
Fix docsearch v3
1 parent 3535e75 commit c868abe

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

src/layouts/index.js

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -366,19 +366,23 @@ class Header extends React.Component {
366366
content: "{% endraw %}";
367367
}
368368
`}</style>
369-
{/*<script
369+
<script
370370
type="text/javascript"
371371
dangerouslySetInnerHTML={{
372372
__html: `
373-
docsearch({
374-
apiKey: "4b6d0afa80197db35886555b5ef4721f",
375-
inputSelector: "#search-docs",
376-
indexName: "graphene_python",
377-
debug: false
378-
});
379-
`
373+
docsearch({
374+
apiKey: "4b6d0afa80197db35886555b5ef4721f",
375+
inputSelector: "#search-docs",
376+
indexName: "graphene_python",
377+
transformData: function(suggestions) {
378+
return suggestions.map(function(suggestion) {
379+
suggestion.url = suggestion.url.replace("http:", "https:");
380+
return suggestion;
381+
});
382+
}
383+
});`
380384
}}
381-
/>*/}
385+
/>
382386
</div>
383387
);
384388
}
@@ -396,7 +400,7 @@ const TemplateWrapper = ({ children, ...otherProps }) => {
396400
]}
397401
>
398402
<script src="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js" />
399-
<script>
403+
{/*<script>
400404
{`
401405
docsearch({
402406
apiKey: "4b6d0afa80197db35886555b5ef4721f",
@@ -409,7 +413,7 @@ const TemplateWrapper = ({ children, ...otherProps }) => {
409413
});
410414
}
411415
});`}
412-
</script>
416+
</script>*/}
413417
</Helmet>
414418
<Header docs={docs} />
415419
<div>{children()}</div>

0 commit comments

Comments
 (0)