Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions docsy.dev/content/en/docs/content/search.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,17 @@ disable search, just comment out or remove the relevant line.

As an alternative to GCSE, you can use
[Algolia DocSearch](https://docsearch.algolia.com), which is free for public
documentation sites. Docsy supports **Algolia DocSearch v3**.
documentation sites. Docsy supports **Algolia DocSearch v4**.

> [!NOTE] Algolia v2 is deprecated
> [!NOTE] Algolia v2 and v3 are deprecated
>
> Docsy previously supported Algolia DocSearch v2, which is now deprecated. If
> you are an existing Algolia DocSearch v2 user and want to use the latest Docsy
> version, follow the
> [migration instructions](https://docsearch.algolia.com/docs/v3/migrating-from-v2)
> in the DocSearch documentation to update your DocSearch code snippet.
>
> Upgrade from v3 to v4 shouldn't require any changes.

### Sign up for Algolia DocSearch

Expand Down Expand Up @@ -228,8 +230,8 @@ params:
<!-- prettier-ignore-end -->
<!-- markdownlint-enable no-shortcut-ref-link -->

To learn more about Algolia DocSearch V3, see
[Getting started](https://docsearch.algolia.com/docs/v3/docsearch).
To learn more about Algolia DocSearch V4, see
[Getting started](https://docsearch.algolia.com/docs/docsearch).

When you've completed these steps, Algolia search should be enabled on your
site. Search results are displayed as a pop-up, so you don't need to add any
Expand Down
3 changes: 1 addition & 2 deletions theme/layouts/_partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@
{{ define "algolia/head" -}}

{{ if and .Site.Params.search (isset .Site.Params.search "algolia") -}}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@docsearch/css@3.8.2"
integrity="sha512-l7pkV1dOURFyHCeH8I4fK9lCkQKuqhlsTCqRl3zktifDlB8oTUJ+mJPgYkK9kHpUut8j1iPquTv32t6hvTPv3g=="
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@docsearch/css@4.7.0"
crossorigin="anonymous" />
{{ end -}}

Expand Down
16 changes: 9 additions & 7 deletions theme/layouts/_partials/scripts.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,20 @@
{{ partial "hooks/body-end.html" . -}}

{{ define "algolia/scripts" -}}
<script src="https://cdn.jsdelivr.net/npm/@docsearch/js@3.8.2"
integrity="sha512-lsD+XVzdBI6ZquXc8gqbw0/bgrfIsMJwY/8xvmvbN+U3gZSeG7BXQoCq4zv/yCmntR2GLHtgB+bD4ESPsKIbIA=="
crossorigin="anonymous" ></script>
<script src="https://cdn.jsdelivr.net/npm/@docsearch/js@4.7.0"
crossorigin="anonymous"></script>
<script type="text/javascript">
const containers = ['#docsearch-0', '#docsearch-1'];
for (let c of containers) {
docsearch({
container: c,
let el = document.querySelector(c);
if (el != null) {
docsearch({
container: el,
appId: {{ .appId | default "R2IYF7ETH7" }},
apiKey: {{ .apiKey | default "599cec31baffa4868cae4e79f180729b" }},
indexName: {{ .indexName | default "docsearch" }},
});
indices: [{{ .indexName | default "docsearch" }}],
});
}
}
</script>
{{ end -}}