Skip to content

Commit 567723b

Browse files
DOC-4344: Add Algolia site keys to playbooks (#121)
* Replace Algolia config values with playbook variables * Conditionally load the DocsSearch script
1 parent 5ca3349 commit 567723b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/partials/body-end-scripts.hbs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,17 @@
44
<script async src="{{{uiRootPath}}}/js/vendor/zooming.js"></script>
55

66
<script src="https://cdn.jsdelivr.net/npm/@docsearch/js@3"></script>
7+
{{#with site.keys}}
8+
{{#if (and algoliaAppId algoliaIndexName algoliaApiKey)}}
79
<script>
810
docsearch({
911
container: '#docsearch',
10-
appId: '2ELPRZR9UC',
11-
indexName: 'crawler_docsearch-astra',
12+
appId: '{{algoliaAppId}}',
13+
indexName: '{{algoliaIndexName}}',
1214
{{!-- This is the public API key which can be safely used in frontend code. --}}
13-
apiKey: '1f4acbf51d118e4137e9a63b38bd8456',
15+
apiKey: '{{algoliaApiKey}}',
1416
})
1517
</script>
18+
{{/if}}
19+
{{/with}}
1620
{{> intercom}}

0 commit comments

Comments
 (0)