|
3 | 3 | <script src="/js/docsearch.js"></script>
|
4 | 4 |
|
5 | 5 | <script type="text/javascript">
|
6 |
| - let siteLang = window.location.pathname.startsWith('/zh/') ? 'zh' : 'en'; |
7 |
| - docsearch({ |
8 |
| - appId: 'V7I042F992', |
9 |
| - apiKey: '8380a7ac88106841cb43fb000fa2edb4', |
10 |
| - indexName: 'cloudwego', |
11 |
| - container: '#docsearch', |
12 |
| - searchParameters: { |
13 |
| - hitsPerPage: 5, |
14 |
| - facetFilters: [`lang:${siteLang}`], |
15 |
| - }, |
16 |
| - //debug: true, // Set debug to true if you want to inspect the modal |
17 |
| - //resultsFooterComponent({ state }) { |
18 |
| - // return { |
19 |
| - // // The HTML `tag` |
20 |
| - // type: 'a', |
21 |
| - // ref: undefined, |
22 |
| - // constructor: undefined, |
23 |
| - // key: state.query, |
24 |
| - // // Its props |
25 |
| - // props: { |
26 |
| - // href: '', |
27 |
| - // target: '_blank', |
28 |
| - // onClick: (event) => { |
29 |
| - // console.log(event); |
30 |
| - // }, |
31 |
| - // // Raw text rendered in the HTML element |
32 |
| - // children: `${state.context.nbHits} hits found!`, |
33 |
| - // }, |
34 |
| - // __v: null, |
35 |
| - // }; |
36 |
| - //}, |
37 |
| - }); |
| 6 | + let siteLang = window.location.pathname.startsWith("/zh/") ? "zh" : "en"; |
| 7 | + if (!["cloudwego.cn", "www.cloudwego.cn"].includes(location.host)) { |
| 8 | + docsearch({ |
| 9 | + appId: "V7I042F992", |
| 10 | + apiKey: "8380a7ac88106841cb43fb000fa2edb4", |
| 11 | + indexName: "cloudwego", |
| 12 | + container: "#docsearch", |
| 13 | + searchParameters: { |
| 14 | + hitsPerPage: 5, |
| 15 | + facetFilters: [`lang:${siteLang}`], |
| 16 | + }, |
| 17 | + //debug: true, // Set debug to true if you want to inspect the modal |
| 18 | + //resultsFooterComponent({ state }) { |
| 19 | + // return { |
| 20 | + // // The HTML `tag` |
| 21 | + // type: 'a', |
| 22 | + // ref: undefined, |
| 23 | + // constructor: undefined, |
| 24 | + // key: state.query, |
| 25 | + // // Its props |
| 26 | + // props: { |
| 27 | + // href: '', |
| 28 | + // target: '_blank', |
| 29 | + // onClick: (event) => { |
| 30 | + // console.log(event); |
| 31 | + // }, |
| 32 | + // // Raw text rendered in the HTML element |
| 33 | + // children: `${state.context.nbHits} hits found!`, |
| 34 | + // }, |
| 35 | + // __v: null, |
| 36 | + // }; |
| 37 | + //}, |
| 38 | + }); |
| 39 | + } |
38 | 40 | </script>
|
39 | 41 |
|
40 | 42 | {{ end }}
|
|
0 commit comments