-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Algolia Docsearch to docs website (#1365)
- Loading branch information
1 parent
16c0019
commit 2b42aa4
Showing
5 changed files
with
235 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--- | ||
--- | ||
|
||
<algolia-searchbox></algolia-searchbox> | ||
|
||
<script> | ||
import docsearch from '@docsearch/js'; | ||
|
||
docsearch({ | ||
appId: import.meta.env.PUBLIC_ALGOLIA_APP_ID, | ||
apiKey: import.meta.env.PUBLIC_ALGOLIA_API_KEY, | ||
indexName: import.meta.env.PUBLIC_ALGOLIA_INDEX_NAME, | ||
container: 'algolia-searchbox', | ||
transformItems: (items) => { | ||
return items.map((item) => { | ||
// Absolute URL -> Relative URL to work better on localhost, preview URLs, etc. | ||
const url = new URL(item.url); | ||
return { | ||
...item, | ||
url: url.href.replace(url.origin, ''), | ||
}; | ||
}); | ||
}, | ||
}); | ||
</script> | ||
|
||
<style lang='scss'> | ||
@import '@docsearch/css' layer(thirdparty.algolia); | ||
|
||
body { | ||
// Algolia DocSearch: https://docsearch.algolia.com/docs/styling/ | ||
--docsearch-primary-color: var(--color-highlight-4); | ||
--docsearch-text-color: var(--color-text--dark); | ||
--docsearch-searchbox-background: var(--color-background-1); | ||
--docsearch-searchbox-focus-background: var(--color-background-1); | ||
--docsearch-hit-color: var(--color-text--dark); | ||
--docsearch-muted-color: var(--color-subtext--dark); | ||
--docsearch-hit-background: var(--color-background-1); | ||
--docsearch-hit-shadow: none; | ||
--docsearch-modal-background: var(--color-background-2); | ||
--docsearch-footer-background: var(--color-background-2); | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,137 @@ | |
resolved "https://registry.yarnpkg.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz#bd9154aec9983f77b3a034ecaa015c2e4201f6cf" | ||
integrity sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA== | ||
|
||
"@algolia/[email protected]": | ||
version "1.9.3" | ||
resolved "https://registry.yarnpkg.com/@algolia/autocomplete-core/-/autocomplete-core-1.9.3.tgz#1d56482a768c33aae0868c8533049e02e8961be7" | ||
integrity sha512-009HdfugtGCdC4JdXUbVJClA0q0zh24yyePn+KUGk3rP7j8FEe/m5Yo/z65gn6nP/cM39PxpzqKrL7A6fP6PPw== | ||
dependencies: | ||
"@algolia/autocomplete-plugin-algolia-insights" "1.9.3" | ||
"@algolia/autocomplete-shared" "1.9.3" | ||
|
||
"@algolia/[email protected]": | ||
version "1.9.3" | ||
resolved "https://registry.yarnpkg.com/@algolia/autocomplete-plugin-algolia-insights/-/autocomplete-plugin-algolia-insights-1.9.3.tgz#9b7f8641052c8ead6d66c1623d444cbe19dde587" | ||
integrity sha512-a/yTUkcO/Vyy+JffmAnTWbr4/90cLzw+CC3bRbhnULr/EM0fGNvM13oQQ14f2moLMcVDyAx/leczLlAOovhSZg== | ||
dependencies: | ||
"@algolia/autocomplete-shared" "1.9.3" | ||
|
||
"@algolia/[email protected]": | ||
version "1.9.3" | ||
resolved "https://registry.yarnpkg.com/@algolia/autocomplete-preset-algolia/-/autocomplete-preset-algolia-1.9.3.tgz#64cca4a4304cfcad2cf730e83067e0c1b2f485da" | ||
integrity sha512-d4qlt6YmrLMYy95n5TB52wtNDr6EgAIPH81dvvvW8UmuWRgxEtY0NJiPwl/h95JtG2vmRM804M0DSwMCNZlzRA== | ||
dependencies: | ||
"@algolia/autocomplete-shared" "1.9.3" | ||
|
||
"@algolia/[email protected]": | ||
version "1.9.3" | ||
resolved "https://registry.yarnpkg.com/@algolia/autocomplete-shared/-/autocomplete-shared-1.9.3.tgz#2e22e830d36f0a9cf2c0ccd3c7f6d59435b77dfa" | ||
integrity sha512-Wnm9E4Ye6Rl6sTTqjoymD+l8DjSTHsHboVRYrKgEt8Q7UHm9nYbqhN/i0fhUYA3OAEH7WA8x3jfpnmJm3rKvaQ== | ||
|
||
"@algolia/[email protected]": | ||
version "4.19.1" | ||
resolved "https://registry.yarnpkg.com/@algolia/cache-browser-local-storage/-/cache-browser-local-storage-4.19.1.tgz#d29f42775ed4d117182897ac164519c593faf399" | ||
integrity sha512-FYAZWcGsFTTaSAwj9Std8UML3Bu8dyWDncM7Ls8g+58UOe4XYdlgzXWbrIgjaguP63pCCbMoExKr61B+ztK3tw== | ||
dependencies: | ||
"@algolia/cache-common" "4.19.1" | ||
|
||
"@algolia/[email protected]": | ||
version "4.19.1" | ||
resolved "https://registry.yarnpkg.com/@algolia/cache-common/-/cache-common-4.19.1.tgz#faa5eeacaffd6023c2cf26e9866bdb06193f9b26" | ||
integrity sha512-XGghi3l0qA38HiqdoUY+wvGyBsGvKZ6U3vTiMBT4hArhP3fOGLXpIINgMiiGjTe4FVlTa5a/7Zf2bwlIHfRqqg== | ||
|
||
"@algolia/[email protected]": | ||
version "4.19.1" | ||
resolved "https://registry.yarnpkg.com/@algolia/cache-in-memory/-/cache-in-memory-4.19.1.tgz#afe4f0f21149800358379871089e0141fb72415b" | ||
integrity sha512-+PDWL+XALGvIginigzu8oU6eWw+o76Z8zHbBovWYcrtWOEtinbl7a7UTt3x3lthv+wNuFr/YD1Gf+B+A9V8n5w== | ||
dependencies: | ||
"@algolia/cache-common" "4.19.1" | ||
|
||
"@algolia/[email protected]": | ||
version "4.19.1" | ||
resolved "https://registry.yarnpkg.com/@algolia/client-account/-/client-account-4.19.1.tgz#1fa65881baab79ad35af6bcf44646a13b8d5edc9" | ||
integrity sha512-Oy0ritA2k7AMxQ2JwNpfaEcgXEDgeyKu0V7E7xt/ZJRdXfEpZcwp9TOg4TJHC7Ia62gIeT2Y/ynzsxccPw92GA== | ||
dependencies: | ||
"@algolia/client-common" "4.19.1" | ||
"@algolia/client-search" "4.19.1" | ||
"@algolia/transporter" "4.19.1" | ||
|
||
"@algolia/[email protected]": | ||
version "4.19.1" | ||
resolved "https://registry.yarnpkg.com/@algolia/client-analytics/-/client-analytics-4.19.1.tgz#e6ed79acd4de5a0284c9696bf4e1c25278ba34db" | ||
integrity sha512-5QCq2zmgdZLIQhHqwl55ZvKVpLM3DNWjFI4T+bHr3rGu23ew2bLO4YtyxaZeChmDb85jUdPDouDlCumGfk6wOg== | ||
dependencies: | ||
"@algolia/client-common" "4.19.1" | ||
"@algolia/client-search" "4.19.1" | ||
"@algolia/requester-common" "4.19.1" | ||
"@algolia/transporter" "4.19.1" | ||
|
||
"@algolia/[email protected]": | ||
version "4.19.1" | ||
resolved "https://registry.yarnpkg.com/@algolia/client-common/-/client-common-4.19.1.tgz#40a8387316fa61d62ad1091beb3a8e227f008e75" | ||
integrity sha512-3kAIVqTcPrjfS389KQvKzliC559x+BDRxtWamVJt8IVp7LGnjq+aVAXg4Xogkur1MUrScTZ59/AaUd5EdpyXgA== | ||
dependencies: | ||
"@algolia/requester-common" "4.19.1" | ||
"@algolia/transporter" "4.19.1" | ||
|
||
"@algolia/[email protected]": | ||
version "4.19.1" | ||
resolved "https://registry.yarnpkg.com/@algolia/client-personalization/-/client-personalization-4.19.1.tgz#fe362e0684dc74c3504c3641c5a7488c6ae02e07" | ||
integrity sha512-8CWz4/H5FA+krm9HMw2HUQenizC/DxUtsI5oYC0Jxxyce1vsr8cb1aEiSJArQT6IzMynrERif1RVWLac1m36xw== | ||
dependencies: | ||
"@algolia/client-common" "4.19.1" | ||
"@algolia/requester-common" "4.19.1" | ||
"@algolia/transporter" "4.19.1" | ||
|
||
"@algolia/[email protected]": | ||
version "4.19.1" | ||
resolved "https://registry.yarnpkg.com/@algolia/client-search/-/client-search-4.19.1.tgz#5e54601aa5f5cea790cec3f2cde4af9d6403871e" | ||
integrity sha512-mBecfMFS4N+yK/p0ZbK53vrZbL6OtWMk8YmnOv1i0LXx4pelY8TFhqKoTit3NPVPwoSNN0vdSN9dTu1xr1XOVw== | ||
dependencies: | ||
"@algolia/client-common" "4.19.1" | ||
"@algolia/requester-common" "4.19.1" | ||
"@algolia/transporter" "4.19.1" | ||
|
||
"@algolia/[email protected]": | ||
version "4.19.1" | ||
resolved "https://registry.yarnpkg.com/@algolia/logger-common/-/logger-common-4.19.1.tgz#0e46a11510f3e94e1afc0ac780ae52e9597be78f" | ||
integrity sha512-i6pLPZW/+/YXKis8gpmSiNk1lOmYCmRI6+x6d2Qk1OdfvX051nRVdalRbEcVTpSQX6FQAoyeaui0cUfLYW5Elw== | ||
|
||
"@algolia/[email protected]": | ||
version "4.19.1" | ||
resolved "https://registry.yarnpkg.com/@algolia/logger-console/-/logger-console-4.19.1.tgz#656a6f4ebb5de39af6ef7095c398d9ab3cceb87d" | ||
integrity sha512-jj72k9GKb9W0c7TyC3cuZtTr0CngLBLmc8trzZlXdfvQiigpUdvTi1KoWIb2ZMcRBG7Tl8hSb81zEY3zI2RlXg== | ||
dependencies: | ||
"@algolia/logger-common" "4.19.1" | ||
|
||
"@algolia/[email protected]": | ||
version "4.19.1" | ||
resolved "https://registry.yarnpkg.com/@algolia/requester-browser-xhr/-/requester-browser-xhr-4.19.1.tgz#7341ea2f980b8980a2976110142026721e452187" | ||
integrity sha512-09K/+t7lptsweRTueHnSnmPqIxbHMowejAkn9XIcJMLdseS3zl8ObnS5GWea86mu3vy4+8H+ZBKkUN82Zsq/zg== | ||
dependencies: | ||
"@algolia/requester-common" "4.19.1" | ||
|
||
"@algolia/[email protected]": | ||
version "4.19.1" | ||
resolved "https://registry.yarnpkg.com/@algolia/requester-common/-/requester-common-4.19.1.tgz#f3396c77631b9d36e8d4d6f819a2c27f9ddbf7a1" | ||
integrity sha512-BisRkcWVxrDzF1YPhAckmi2CFYK+jdMT60q10d7z3PX+w6fPPukxHRnZwooiTUrzFe50UBmLItGizWHP5bDzVQ== | ||
|
||
"@algolia/[email protected]": | ||
version "4.19.1" | ||
resolved "https://registry.yarnpkg.com/@algolia/requester-node-http/-/requester-node-http-4.19.1.tgz#ea210de9642628b3bdda1dd7fcd1fcb686da442e" | ||
integrity sha512-6DK52DHviBHTG2BK/Vv2GIlEw7i+vxm7ypZW0Z7vybGCNDeWzADx+/TmxjkES2h15+FZOqVf/Ja677gePsVItA== | ||
dependencies: | ||
"@algolia/requester-common" "4.19.1" | ||
|
||
"@algolia/[email protected]": | ||
version "4.19.1" | ||
resolved "https://registry.yarnpkg.com/@algolia/transporter/-/transporter-4.19.1.tgz#b5787299740c4bec9ba05502d98c14b5999860c8" | ||
integrity sha512-nkpvPWbpuzxo1flEYqNIbGz7xhfhGOKGAZS7tzC+TELgEmi7z99qRyTfNSUlW7LZmB3ACdnqAo+9A9KFBENviQ== | ||
dependencies: | ||
"@algolia/cache-common" "4.19.1" | ||
"@algolia/logger-common" "4.19.1" | ||
"@algolia/requester-common" "4.19.1" | ||
|
||
"@ampproject/remapping@^2.2.0": | ||
version "2.2.0" | ||
resolved "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz" | ||
|
@@ -1598,6 +1729,29 @@ | |
resolved "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz" | ||
integrity sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw== | ||
|
||
"@docsearch/css@3", "@docsearch/[email protected]": | ||
version "3.5.1" | ||
resolved "https://registry.yarnpkg.com/@docsearch/css/-/css-3.5.1.tgz#4adf9884735bbfea621c3716e80ea97baa419b73" | ||
integrity sha512-2Pu9HDg/uP/IT10rbQ+4OrTQuxIWdKVUEdcw9/w7kZJv9NeHS6skJx1xuRiFyoGKwAzcHXnLp7csE99sj+O1YA== | ||
|
||
"@docsearch/js@3": | ||
version "3.5.1" | ||
resolved "https://registry.yarnpkg.com/@docsearch/js/-/js-3.5.1.tgz#6d8de3b4fcf7de94462c0e592e333efa9ebbbabd" | ||
integrity sha512-EXi8de5njxgP6TV3N9ytnGRLG9zmBNTEZjR4VzwPcpPLbZxxTLG2gaFyJyKiFVQxHW/DPlMrDJA3qoRRGEkgZw== | ||
dependencies: | ||
"@docsearch/react" "3.5.1" | ||
preact "^10.0.0" | ||
|
||
"@docsearch/[email protected]": | ||
version "3.5.1" | ||
resolved "https://registry.yarnpkg.com/@docsearch/react/-/react-3.5.1.tgz#35f4a75f948211d8bb6830d2147c575f96a85274" | ||
integrity sha512-t5mEODdLzZq4PTFAm/dvqcvZFdPDMdfPE5rJS5SC8OUq9mPzxEy6b+9THIqNM9P0ocCb4UC5jqBrxKclnuIbzQ== | ||
dependencies: | ||
"@algolia/autocomplete-core" "1.9.3" | ||
"@algolia/autocomplete-preset-algolia" "1.9.3" | ||
"@docsearch/css" "3.5.1" | ||
algoliasearch "^4.0.0" | ||
|
||
"@emmetio/abbreviation@^2.2.3": | ||
version "2.2.3" | ||
resolved "https://registry.npmjs.org/@emmetio/abbreviation/-/abbreviation-2.2.3.tgz" | ||
|
@@ -4483,6 +4637,26 @@ ajv@^8.0.1: | |
require-from-string "^2.0.2" | ||
uri-js "^4.2.2" | ||
|
||
algoliasearch@^4.0.0: | ||
version "4.19.1" | ||
resolved "https://registry.yarnpkg.com/algoliasearch/-/algoliasearch-4.19.1.tgz#18111fb422eaf841737adb92d5ab12133d244218" | ||
integrity sha512-IJF5b93b2MgAzcE/tuzW0yOPnuUyRgGAtaPv5UUywXM8kzqfdwZTO4sPJBzoGz1eOy6H9uEchsJsBFTELZSu+g== | ||
dependencies: | ||
"@algolia/cache-browser-local-storage" "4.19.1" | ||
"@algolia/cache-common" "4.19.1" | ||
"@algolia/cache-in-memory" "4.19.1" | ||
"@algolia/client-account" "4.19.1" | ||
"@algolia/client-analytics" "4.19.1" | ||
"@algolia/client-common" "4.19.1" | ||
"@algolia/client-personalization" "4.19.1" | ||
"@algolia/client-search" "4.19.1" | ||
"@algolia/logger-common" "4.19.1" | ||
"@algolia/logger-console" "4.19.1" | ||
"@algolia/requester-browser-xhr" "4.19.1" | ||
"@algolia/requester-common" "4.19.1" | ||
"@algolia/requester-node-http" "4.19.1" | ||
"@algolia/transporter" "4.19.1" | ||
|
||
ansi-align@^3.0.0, ansi-align@^3.0.1: | ||
version "3.0.1" | ||
resolved "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz" | ||
|
@@ -12097,6 +12271,11 @@ [email protected], [email protected], postcss@^7, postcss@^8.3.11, postcss@^8.4.21, po | |
picocolors "^1.0.0" | ||
source-map-js "^1.0.2" | ||
|
||
preact@^10.0.0: | ||
version "10.16.0" | ||
resolved "https://registry.yarnpkg.com/preact/-/preact-10.16.0.tgz#68a06d70b191b8a313ea722d61e09c6b2a79a37e" | ||
integrity sha512-XTSj3dJ4roKIC93pald6rWuB2qQJO9gO2iLLyTe87MrjQN+HklueLsmskbywEWqCHlclgz3/M4YLL2iBr9UmMA== | ||
|
||
preferred-pm@^3.0.0, preferred-pm@^3.0.3: | ||
version "3.0.3" | ||
resolved "https://registry.npmjs.org/preferred-pm/-/preferred-pm-3.0.3.tgz" | ||
|
@@ -13257,9 +13436,9 @@ semver-truncate@^3.0.0: | |
semver "^7.3.5" | ||
|
||
"semver@2 || 3 || 4 || 5", semver@^5.4.1, semver@^5.5.0, semver@^5.6.0, semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semver@^7.3.8, semver@^7.5.2, semver@^7.5.3, semver@~7.0.0: | ||
version "7.5.3" | ||
resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.3.tgz#161ce8c2c6b4b3bdca6caadc9fa3317a4c4fe88e" | ||
integrity sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ== | ||
version "7.5.4" | ||
resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" | ||
integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== | ||
dependencies: | ||
lru-cache "^6.0.0" | ||
|
||
|