Commit f7f0026 1 parent 45fe28c commit f7f0026 Copy full SHA for f7f0026
File tree 4 files changed +18
-4
lines changed
4 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,11 @@ params:
73
73
analytics :
74
74
fathom_site : " ITUSEYJG"
75
75
76
+ algolia :
77
+ appId : " AK7KMZKZHQ"
78
+ apiKey : " 3151f502c7b9e9dafd5e6372b691a24e"
79
+ indexName : " bootstrap"
80
+
76
81
download :
77
82
source : " https://github.com/twbs/bootstrap/archive/v5.3.3.zip"
78
83
dist : " https://github.com/twbs/bootstrap/releases/download/v5.3.3/bootstrap-5.3.3-dist.zip"
Original file line number Diff line number Diff line change 10
10
*/
11
11
12
12
import docsearch from '@docsearch/js'
13
+ // https://gohugo.io/hugo-pipes/js/#options
14
+ // eslint-disable-next-line import/no-unresolved
15
+ import { appId , apiKey , indexName } from '@params' ;
13
16
14
17
( ( ) => {
15
18
const searchElement = document . getElementById ( 'docsearch' )
@@ -21,9 +24,9 @@ import docsearch from '@docsearch/js'
21
24
const siteDocsVersion = searchElement . getAttribute ( 'data-bd-docs-version' )
22
25
23
26
docsearch ( {
24
- apiKey : '3151f502c7b9e9dafd5e6372b691a24e' ,
25
- indexName : 'bootstrap' ,
26
- appId : 'AK7KMZKZHQ' ,
27
+ apiKey,
28
+ indexName,
29
+ appId,
27
30
container : searchElement ,
28
31
searchParameters : {
29
32
facetFilters : [ `version:${ siteDocsVersion } ` ]
Original file line number Diff line number Diff line change 10
10
< link rel ="canonical " href ="{{ .Permalink }} ">
11
11
12
12
{{ if (ne .Page.Layout "examples") -}}
13
- < link rel ="preconnect " href ="https://ak7kmzkzhq -dsn.algolia.net " crossorigin >
13
+ < link rel ="preconnect " href ="https://{{ .Site.Params.algolia.appId | lower }} -dsn.algolia.net " crossorigin >
14
14
{{- end }}
15
15
16
16
< title > {{ if .IsHome }}{{ .Site.Title | markdownify }} · {{ .Site.Params.subtitle | markdownify }}{{ else }}{{ .Title | markdownify }} · {{ .Site.Title | markdownify }} v{{ .Site.Params.docs_version }}{{ end }}</ title >
Original file line number Diff line number Diff line change 15
15
< script defer src ="{{ $applicationJs.RelPermalink }} "> </ script >
16
16
17
17
{{- if (ne .Page.Layout "examples") -}}
18
+ {{- $esbuildParams := dict
19
+ "apiKey" .Site.Params.algolia.apiKey
20
+ "appId" .Site.Params.algolia.appId
21
+ "indexName" .Site.Params.algolia.indexName
22
+ -}}
23
+ {{- $esbuildOptions = merge $esbuildOptions (dict "params" $esbuildParams) -}}
18
24
{{- $searchJs := resources.Get "js/search.js" | js.Build $esbuildOptions | resources.Copy (path.Join $targetDocsJSPath "/assets/js/search.js") }}
19
25
< script defer src ="{{ $searchJs.RelPermalink }} "> </ script >
20
26
{{- end -}}
You can’t perform that action at this time.
0 commit comments