Welcome to mirror list, hosted at ThFree Co, Russian Federation.

docsearch.js « javascripts « assets « content - gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d908b69d504f22f77b8270d07db4c88bc5e81a9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
---
version: 4
---

document.addEventListener('DOMContentLoaded', () => {
  let version = "main"
  if (document.querySelector('meta[name="docsearch:version"]').content.length > 0) {
    version = document.querySelector('meta[name="docsearch:version"]').content;
  }

  // eslint-disable-next-line no-undef
  docsearch({
    apiKey: '89b85ffae982a7f1adeeed4a90bb0ab1',
    indexName: 'gitlab',
    container: '#docsearch',
    appId: "3PNCFOU757",
    placeholder: 'Search the docs',
    searchParameters: {
      facetFilters: [`version:${version}`],
    },
    resultsFooterComponent({ state }) {
      return {
        type: "a",
        ref: undefined,
        constructor: undefined,
        key: state.query,
        props: {
          href: `/search/?query=${state.query}`,
          children: `See all results`
        },
        __v: null
      }
    }
  });
});