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

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Otto <markd.otto@gmail.com>2022-05-07 02:56:43 +0300
committerGitHub <noreply@github.com>2022-05-07 02:56:43 +0300
commit6b49d26b21cabb7322a820183c6d925263cddba1 (patch)
treea20884b37e88ed3f4bb7ac2b653f10d64816396d /site/layouts
parentd2497b0384d05af9159743d7ff58fd071d5c5cbb (diff)
v5.2.0: Migrate to DocSearch 3 (#36176)
* Migrate to DocSearch v3 Fixes #33338 * initialize `siteDocsVersion` const after the proper check * Update site/layouts/partials/stylesheet.html Co-authored-by: GeoSot <geo.sotis@gmail.com> * Update header.html * code review changes * Update search.js * Fix contrast issue, tweak some styles * Fix some navbar changes * temporary safari fix for docsearch3 Co-authored-by: GeoSot <geo.sotis@gmail.com> Co-authored-by: XhmikosR <xhmikosr@gmail.com>
Diffstat (limited to 'site/layouts')
-rw-r--r--site/layouts/_default/docs.html1
-rw-r--r--site/layouts/partials/docs-navbar.html4
-rw-r--r--site/layouts/partials/docs-versions.html4
-rw-r--r--site/layouts/partials/header.html4
-rw-r--r--site/layouts/partials/scripts.html2
-rw-r--r--site/layouts/partials/stylesheet.html5
6 files changed, 13 insertions, 7 deletions
diff --git a/site/layouts/_default/docs.html b/site/layouts/_default/docs.html
index 3c61cd3421..d08e5a393a 100644
--- a/site/layouts/_default/docs.html
+++ b/site/layouts/_default/docs.html
@@ -62,4 +62,5 @@
{{ range .Page.Params.extra_js -}}
<script{{ with .async }} async{{ end }} src="{{ .src }}"></script>
{{- end -}}
+ <div class="position-fixed"><input type="text"></div>
{{ end }}
diff --git a/site/layouts/partials/docs-navbar.html b/site/layouts/partials/docs-navbar.html
index 441c2bd56a..c54d3fa447 100644
--- a/site/layouts/partials/docs-navbar.html
+++ b/site/layouts/partials/docs-navbar.html
@@ -46,9 +46,7 @@
<hr class="d-lg-none text-white-50">
{{ if eq .Layout "docs" }}
- <form class="bd-search" data-shortcut="⌘K">
- <input type="search" class="form-control" id="search-input" placeholder="Search docs..." aria-label="Search docs for..." autocomplete="off" data-bd-docs-version="{{ .Site.Params.docs_version }}">
- </form>
+ <div class="bd-search" id="docsearch" data-bd-docs-version="{{ .Site.Params.docs_version }}"></div>
<hr class="d-lg-none text-white-50">
{{ end }}
diff --git a/site/layouts/partials/docs-versions.html b/site/layouts/partials/docs-versions.html
index 8e34122bea..fb340bb59c 100644
--- a/site/layouts/partials/docs-versions.html
+++ b/site/layouts/partials/docs-versions.html
@@ -11,9 +11,9 @@
{{- end }}
<li class="nav-item dropdown">
- <a href="#" class="nav-link py-2 px-0 px-lg-2 dropdown-toggle" id="bd-versions" data-bs-toggle="dropdown" aria-expanded="false" data-bs-display="static">
+ <button class="btn btn-link nav-link py-2 px-0 px-lg-2 dropdown-toggle" id="bd-versions" data-bs-toggle="dropdown" aria-expanded="false" data-bs-display="static">
<span class="d-lg-none">Bootstrap</span> v{{ .Site.Params.docs_version }}
- </a>
+ </button>
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="bd-versions">
<li><h6 class="dropdown-header">v5 releases</h6></li>
<li>
diff --git a/site/layouts/partials/header.html b/site/layouts/partials/header.html
index 2d2eb29d9f..a592cdccb8 100644
--- a/site/layouts/partials/header.html
+++ b/site/layouts/partials/header.html
@@ -11,6 +11,10 @@
<link rel="canonical" href="{{ .Permalink }}">
+{{- if eq .Page.Layout "docs" -}}
+<link rel="preconnect" href="https://AK7KMZKZHQ-dsn.algolia.net" crossorigin>
+{{- end }}
+
{{ with .Params.robots -}}
<meta name="robots" content="{{ . }}">
{{- end }}
diff --git a/site/layouts/partials/scripts.html b/site/layouts/partials/scripts.html
index 5e2e52e90b..56513c7ff8 100644
--- a/site/layouts/partials/scripts.html
+++ b/site/layouts/partials/scripts.html
@@ -5,7 +5,7 @@
{{- end }}
{{ if eq .Page.Layout "docs" -}}
-<script src="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js"></script>
+<script src="https://cdn.jsdelivr.net/npm/@docsearch/js@3"></script>
<script src="https://cdn.jsdelivr.net/npm/@stackblitz/sdk@1/bundles/sdk.umd.js"></script>
{{- end }}
diff --git a/site/layouts/partials/stylesheet.html b/site/layouts/partials/stylesheet.html
index cc44733836..1aa3296990 100644
--- a/site/layouts/partials/stylesheet.html
+++ b/site/layouts/partials/stylesheet.html
@@ -1,4 +1,7 @@
-{{- "<!-- Bootstrap core CSS -->" | safeHTML }}
+{{ if eq .Page.Layout "docs" -}}
+<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@docsearch/css@3">
+{{- end }}
+
{{ if eq hugo.Environment "production" -}}
{{ if eq .Page.Params.direction "rtl" -}}
<link href="/docs/{{ .Site.Params.docs_version }}/dist/css/bootstrap.rtl.min.css" rel="stylesheet" {{ printf "integrity=%q" .Site.Params.cdn.css_rtl_hash | safeHTMLAttr }} crossorigin="anonymous">