Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docs search to homepage #38850

Merged
merged 2 commits into from
Jul 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 2 additions & 4 deletions site/layouts/partials/docs-navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,15 @@
</button>
</div>
{{- else }}
<div class="d-lg-none" style="width: 1.5rem;"></div>
<div class="d-lg-none" style="width: 4.25rem;"></div>
{{- end }}

<a class="navbar-brand p-0 me-0 me-lg-2" href="/" aria-label="Bootstrap">
{{ partial "icons/bootstrap-white-fill.svg" (dict "class" "d-block my-1" "width" "40" "height" "32") }}
</a>

<div class="d-flex">
{{ if eq .Layout "docs" }}
<div class="bd-search" id="docsearch" data-bd-docs-version="{{ .Site.Params.docs_version }}"></div>
{{ end }}
<div class="bd-search" id="docsearch" data-bd-docs-version="{{ .Site.Params.docs_version }}"></div>

<button class="navbar-toggler d-flex d-lg-none order-3 p-2" type="button" data-bs-toggle="offcanvas" data-bs-target="#bdNavbar" aria-controls="bdNavbar" aria-label="Toggle navigation">
<svg class="bi" aria-hidden="true"><use xlink:href="#three-dots"></use></svg>
Expand Down
2 changes: 0 additions & 2 deletions site/layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@

<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="{{ . }}">
Expand Down
3 changes: 2 additions & 1 deletion site/layouts/partials/scripts.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
<script src="/docs/{{ .Site.Params.docs_version }}/dist/js/bootstrap.bundle.js"></script>
{{- end }}

{{ if eq .Page.Layout "docs" -}}
<script src="https://cdn.jsdelivr.net/npm/@docsearch/js@3"></script>

{{ if eq .Page.Layout "docs" -}}
<script src="https://cdn.jsdelivr.net/npm/@stackblitz/sdk@1/bundles/sdk.umd.js"></script>
{{- end }}

Expand Down
2 changes: 0 additions & 2 deletions site/layouts/partials/stylesheet.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{{ 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" -}}
Expand Down