mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-29 16:19:53 +02:00
docs: move algolia config to hugo config
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
<link rel="canonical" href="{{ .Permalink }}">
|
||||
|
||||
{{ if (ne .Page.Layout "examples") -}}
|
||||
<link rel="preconnect" href="https://ak7kmzkzhq-dsn.algolia.net" crossorigin>
|
||||
<link rel="preconnect" href="https://{{ .Site.Params.algolia.appId | lower }}-dsn.algolia.net" crossorigin>
|
||||
{{- end }}
|
||||
|
||||
<title>{{ if .IsHome }}{{ .Site.Title | markdownify }} · {{ .Site.Params.subtitle | markdownify }}{{ else }}{{ .Title | markdownify }} · {{ .Site.Title | markdownify }} v{{ .Site.Params.docs_version }}{{ end }}</title>
|
||||
|
@@ -15,6 +15,12 @@
|
||||
<script defer src="{{ $applicationJs.RelPermalink }}"></script>
|
||||
|
||||
{{- if (ne .Page.Layout "examples") -}}
|
||||
{{- $esbuildParams := dict
|
||||
"apiKey" .Site.Params.algolia.apiKey
|
||||
"appId" .Site.Params.algolia.appId
|
||||
"indexName" .Site.Params.algolia.indexName
|
||||
-}}
|
||||
{{- $esbuildOptions = merge $esbuildOptions (dict "params" $esbuildParams) -}}
|
||||
{{- $searchJs := resources.Get "js/search.js" | js.Build $esbuildOptions | resources.Copy (path.Join $targetDocsJSPath "/assets/js/search.js") }}
|
||||
<script defer src="{{ $searchJs.RelPermalink }}"></script>
|
||||
{{- end -}}
|
||||
|
Reference in New Issue
Block a user