Skip to content

Commit

Permalink
local files
Browse files Browse the repository at this point in the history
  • Loading branch information
yfanti committed Jun 27, 2024
1 parent 7ab4651 commit 1be7932
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
5 changes: 1 addition & 4 deletions src/js/vendor/search-algolia.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import docsearch from '@docsearch/js'
import '@docsearch/css'

window.antoraAlgolia = (function () {
const scriptAttrs = document.getElementById('search-script').dataset
const apiKey = scriptAttrs.apiKey
Expand All @@ -13,7 +10,7 @@ window.antoraAlgolia = (function () {
appId: apiId,
indexName: indexName,
container: '#search-input',
searchParameters: { sfacetFilters: ['language:en', 'version:1.0.0'] },
searchParameters: { sfacetFilters: ['language:n', 'version:1.0.0'] },
autocompleteOptions: { hint: false, keyboardShortcuts: ['s'] },
}).autocomplete

Expand Down
3 changes: 1 addition & 2 deletions src/partials/footer-scripts.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
<script src="{{{uiRootPath}}}/js/vendor/search-lunr.js" id="search-script" data-base-path="{{or siteRootPath (or site.url siteRootUrl)}}" data-page-path="{{@root.page.url}}"></script>
<script async src="{{uiRootPath}}/../search-index.js"></script>
{{else if (eq env.SEARCH_ENGINE 'algolia')}}
{{!-- <script src="{{{uiRootPath}}}/js/vendor/docsearch-3.6.0.js"></script> --}}
<script src="https://cdn.jsdelivr.net/npm/@docsearch/js@3"></script>
<script src="{{{uiRootPath}}}/js/vendor/docsearch-3.6.0.js"></script>
<script src="{{{uiRootPath}}}/js/vendor/search-algolia.js" id="search-script" data-api-key="{{env.ALGOLIA_API_KEY}}" data-api-id="{{env.ALGOLIA_APPLICATION_ID}}" data-index-name="{{env.ALGOLIA_INDEX_NAME}}"></script>
{{/if}}
{{/if}}
4 changes: 2 additions & 2 deletions src/partials/head-styles.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{{#if (eq env.SEARCH_ENGINE 'lunr')}}
<link rel="stylesheet" href="{{{uiRootPath}}}/css/vendor/lunr.css">
{{else if (eq env.SEARCH_ENGINE 'algolia')}}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@docsearch/css@3" />
{{!-- <link rel="stylesheet" href="{{{uiRootPath}}}/css/vendor/docsearch-3.6.0.css"> --}}
{{!-- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@docsearch/css@3" /> --}}
<link rel="stylesheet" href="{{{uiRootPath}}}/css/vendor/docsearch-3.6.0.css">
{{/if}}
{{/if}}

0 comments on commit 1be7932

Please sign in to comment.