From 85fb3b5ff0cdb08be71b35c36198e89bd3526a1b Mon Sep 17 00:00:00 2001 From: FabianLars Date: Thu, 26 Jan 2023 14:09:44 +0100 Subject: [PATCH 01/16] meilisearch evaluation --- scraper.json | 22 ++++++++++++++++++++++ src/theme/SearchBar/index.js | 8 ++++---- static/algolia.html | 21 +++++++++++++++++++++ 3 files changed, 47 insertions(+), 4 deletions(-) create mode 100644 scraper.json create mode 100644 static/algolia.html diff --git a/scraper.json b/scraper.json new file mode 100644 index 0000000000..24cbda4b66 --- /dev/null +++ b/scraper.json @@ -0,0 +1,22 @@ +{ + "index_uid": "docs-v1", + "start_urls": ["https://tauri.app/v1/"], + "sitemap_urls": ["https://tauri.app/sitemap.xml"], + "stop_urls": [], + "selectors": { + "lvl0": { + "selector": "", + "default_value": "Documentation" + }, + "lvl1": { + "selector": "h1", + "global": true, + "default_value": "Guide" + }, + "lvl2": "article h2", + "lvl3": "article h3", + "lvl4": "article h4", + "lvl5": "article h5", + "text": "article p, article li" + } +} diff --git a/src/theme/SearchBar/index.js b/src/theme/SearchBar/index.js index e0bd15e4c4..2dd4506e55 100644 --- a/src/theme/SearchBar/index.js +++ b/src/theme/SearchBar/index.js @@ -6,12 +6,12 @@ export default function Component() { const DocsSearchBar = require('docs-searchbar.js').default DocsSearchBar({ - hostUrl: 'https://search2.tauri.studio', + hostUrl: 'https://ms-0fcdc03da8a1-1619.fra.meilisearch.io', apiKey: - 'XZEH8BS90ee09c45215a8421c06857bcbde5c1a6797bdf4859a57a3ac1228a2b81df0994', - indexUid: 'consolidated', + '3d2bbfaafc279147240ad562ee4d212437f1e78f0470bfab36690f0ba3a36958', + indexUid: 'docs-v1', inputSelector: '#search-bar-input', - debug: process.env.NODE_ENV === 'development', + debug: true, }) }, []) diff --git a/static/algolia.html b/static/algolia.html new file mode 100644 index 0000000000..c49598bab8 --- /dev/null +++ b/static/algolia.html @@ -0,0 +1,21 @@ + + + + + + + + + + From 77b40055935f38c92a0db76c709b5023943e752c Mon Sep 17 00:00:00 2001 From: FabianLars Date: Thu, 26 Jan 2023 16:04:21 +0100 Subject: [PATCH 02/16] correctly group categories --- scraper.json | 70 ++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 57 insertions(+), 13 deletions(-) diff --git a/scraper.json b/scraper.json index 24cbda4b66..c9f2ce811e 100644 --- a/scraper.json +++ b/scraper.json @@ -1,22 +1,66 @@ { "index_uid": "docs-v1", - "start_urls": ["https://tauri.app/v1/"], + "start_urls": [ + { + "url": "https://tauri.app/v1/guides/", + "selectors_key": "guides" + }, + { + "url": "https://tauri.app/v1/api/js/", + "selectors_key": "api-js" + }, + { + "url": "https://tauri.app/v1/references/", + "selectors_key": "references" + }, + "https://tauri.app/v1/" + ], "sitemap_urls": ["https://tauri.app/sitemap.xml"], "stop_urls": [], "selectors": { - "lvl0": { - "selector": "", - "default_value": "Documentation" + "default": { + "lvl0": "article h1", + "lvl1": "article h2", + "lvl2": "article h3", + "lvl3": "article h4", + "lvl4": "article h5", + "text": "article p, article li" + }, + "guides": { + "lvl0": { + "selector": "", + "default_value": "Documentation" + }, + "lvl1": "article h1", + "lvl2": "article h2", + "lvl3": "article h3", + "lvl4": "article h4", + "lvl5": "article h5", + "text": "article p, article li" }, - "lvl1": { - "selector": "h1", - "global": true, - "default_value": "Guide" + "api-js": { + "lvl0": { + "selector": "", + "default_value": "JS API" + }, + "lvl1": "article h1", + "lvl2": "article h2", + "lvl3": "article h3", + "lvl4": "article h4", + "lvl5": "article h5", + "text": "article p, article li" }, - "lvl2": "article h2", - "lvl3": "article h3", - "lvl4": "article h4", - "lvl5": "article h5", - "text": "article p, article li" + "references": { + "lvl0": { + "selector": "", + "default_value": "References" + }, + "lvl1": "article h1", + "lvl2": "article h2", + "lvl3": "article h3", + "lvl4": "article h4", + "lvl5": "article h5", + "text": "article p, article li" + } } } From a61fc22fd3973baae4edf07fe8d65aa8156b96c1 Mon Sep 17 00:00:00 2001 From: FabianLars Date: Thu, 26 Jan 2023 17:01:12 +0100 Subject: [PATCH 03/16] dry-run automatic index update --- .github/workflows/build.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 68e1ce3084..90226a07b5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -139,3 +139,21 @@ jobs: env: NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} + + update-search-index: + needs: deploy-to-netlify + #if: github.event_name == 'push' && github.ref_name == 'dev' disabled to test the config paths + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Run scraper + env: + HOST_URL: ${{ secrets.MEILISEARCH_HOST_URL }} + API_KEY: ${{ secrets.MEILISEARCH_API_KEY }} + CONFIG_FILE_PATH: './scraper.json' + run: | + docker run -t --rm \ + -e MEILISEARCH_HOST_URL=$HOST_URL \ + -e MEILISEARCH_API_KEY=$API_KEY \ + -v $CONFIG_FILE_PATH:/docs-scraper/scraper.json \ + getmeili/docs-scraper:v0.12.6 pipenv run ./docs_scraper ./scraper.json From a4b73532d93af2e47b8ed267ed77fe3a8c7fa9a5 Mon Sep 17 00:00:00 2001 From: FabianLars Date: Thu, 26 Jan 2023 17:15:00 +0100 Subject: [PATCH 04/16] use api key from secret --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 90226a07b5..897f82489c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -142,15 +142,15 @@ jobs: update-search-index: needs: deploy-to-netlify - #if: github.event_name == 'push' && github.ref_name == 'dev' disabled to test the config paths + if: github.event_name == 'push' && github.ref_name == 'dev' runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Run scraper env: - HOST_URL: ${{ secrets.MEILISEARCH_HOST_URL }} - API_KEY: ${{ secrets.MEILISEARCH_API_KEY }} - CONFIG_FILE_PATH: './scraper.json' + HOST_URL: 'https://search.tauri.studio' + API_KEY: ${{ secrets.SEARCH_ADMIN_API_KEY }} + CONFIG_FILE_PATH: ${{ github.workspace }}/scraper.json run: | docker run -t --rm \ -e MEILISEARCH_HOST_URL=$HOST_URL \ From a556d5cc24b6d8a939b363b4a0cde904bffd06b3 Mon Sep 17 00:00:00 2001 From: FabianLars Date: Thu, 26 Jan 2023 17:15:28 +0100 Subject: [PATCH 05/16] temporarily use default searchbar css --- src/theme/SearchBar/style.css | 1140 ++++++++++++++++++++++++++++++--- 1 file changed, 1056 insertions(+), 84 deletions(-) diff --git a/src/theme/SearchBar/style.css b/src/theme/SearchBar/style.css index ca5b678952..4e40233b34 100644 --- a/src/theme/SearchBar/style.css +++ b/src/theme/SearchBar/style.css @@ -1,107 +1,1079 @@ -/* Prevents zooming in on mobile */ -@media screen and (max-width: 996px) { - input#search-bar-input { - font-size: 16px !important; - } +.searchbox { + display: inline-block; + position: relative; + width: 200px; + height: 32px; + white-space: nowrap; + box-sizing: border-box; + visibility: visible; } - -/* Main dropdown wrapper */ -.meilisearch-autocomplete .dsb-dropdown-menu { - background-color: var(--ifm-card-background-color); - border-radius: var(--ifm-card-border-radius); - box-shadow: var(--ifm-global-shadow-md); - max-height: calc(100vh - var(--ifm-navbar-height)); - width: min(calc(90vw - var(--ifm-navbar-padding-horizontal)), 35rem); - z-index: unset !important; +.searchbox .meilisearch-autocomplete { + display: block; + width: 100%; + height: 100%; +} +.searchbox__wrapper { + width: 100%; + height: 100%; + z-index: 999; + position: relative; +} +.searchbox input { + color: #555; + display: inline-block; + box-sizing: border-box; + transition: box-shadow 0.4s ease, background 0.4s ease; + border: 0; + border-radius: 16px; + box-shadow: inset 0 0 0 1px #ccc; + background: #fff; + padding: 0 26px 0 32px; + width: 100%; + height: 100%; + vertical-align: middle; + white-space: normal; + font-size: 12px; + -moz-appearance: none; + appearance: none; +} +.searchbox input::-webkit-search-cancel-button, +.searchbox input::-webkit-search-decoration, +.searchbox input::-webkit-search-results-button, +.searchbox input::-webkit-search-results-decoration { + display: none; +} +.searchbox input:hover { + box-shadow: inset 0 0 0 1px #b3b3b3; +} +.searchbox input:active, +.searchbox input:focus { + outline: 0; + box-shadow: inset 0 0 0 1px #aaa; + background: #fff; +} +.searchbox input::-moz-placeholder { + color: #aaa; +} +.searchbox input::placeholder { + color: #aaa; +} +.searchbox__submit { + position: absolute; + top: 0; + margin: 0; + border: 0; + border-radius: 16px 0 0 16px; + background-color: rgba(69, 142, 225, 0); + padding: 0; + width: 32px; + height: 100%; + vertical-align: middle; + text-align: center; + font-size: inherit; + -moz-user-select: none; + user-select: none; + right: inherit; + left: 0; +} +.searchbox__submit:before { + display: inline-block; + margin-right: -4px; + height: 100%; + vertical-align: middle; + content: ''; +} +.searchbox__submit:active, +.searchbox__submit:hover { + cursor: pointer; +} +.searchbox__submit:focus { + outline: 0; +} +.searchbox__submit svg { + width: 14px; + height: 14px; + vertical-align: middle; + fill: #6d7e96; +} +.searchbox__reset { + display: block; + position: absolute; + top: 8px; + right: 8px; + margin: 0; + border: 0; + background: none; + cursor: pointer; + padding: 0; + font-size: inherit; + -moz-user-select: none; + user-select: none; + fill: rgba(0, 0, 0, 0.5); +} +.searchbox__reset.hide { + display: none; +} +.searchbox__reset:focus { + outline: 0; +} +.searchbox__reset svg { + display: block; + margin: 4px; + width: 8px; + height: 8px; +} +.searchbox__input:valid ~ .searchbox__reset { + display: block; + animation-name: sbx-reset-in; + animation-duration: 0.15s; +} +.meilisearch-autocomplete.meilisearch-autocomplete-right .dsb-dropdown-menu { right: 0; - overflow-y: scroll; -} - -/* Content */ -.meilisearch-autocomplete .dsb-suggestions, -.docs-searchbar-suggestion--no-results { - padding: var(--ifm-card-vertical-spacing) var(--ifm-card-horizontal-spacing); -} - -/* A single suggestion */ -.meilisearch-autocomplete .dsb-suggestion { - padding: 0.25rem 0.5rem; + left: inherit; +} +.meilisearch-autocomplete.meilisearch-autocomplete-right + .dsb-dropdown-menu:before { + right: 48px; +} +.meilisearch-autocomplete.meilisearch-autocomplete-left .dsb-dropdown-menu { + left: 0; + right: inherit; +} +.meilisearch-autocomplete.meilisearch-autocomplete-left + .dsb-dropdown-menu:before { + left: 48px; +} +.meilisearch-autocomplete .dsb-dropdown-menu { + position: relative; + top: -6px; + border-radius: 4px; + margin: 6px 0 0; + padding: 0; + text-align: left; + height: auto; + background: transparent; + border: none; + z-index: 999; + max-width: 600px; + min-width: 500px; + box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.2), 0 2px 3px 0 rgba(0, 0, 0, 0.1); +} +.meilisearch-autocomplete .dsb-dropdown-menu:before { + display: block; + position: absolute; + content: ''; + width: 14px; + height: 14px; + background: #fff; + z-index: 1000; + top: -7px; + border-top: 1px solid #d9d9d9; + border-right: 1px solid #d9d9d9; + transform: rotate(-45deg); + border-radius: 2px; +} +.meilisearch-autocomplete .dsb-dropdown-menu .dsb-suggestions { + position: relative; + z-index: 1000; + margin-top: 8px; +} +.meilisearch-autocomplete .dsb-dropdown-menu .dsb-suggestions a:hover { text-decoration: none; - border-radius: 0.5rem; } - -.meilisearch-autocomplete .dsb-suggestion:hover { - background-color: var(--ifm-dropdown-hover-background-color); - color: var(--ifm-dropdown-link-color); +.meilisearch-autocomplete .dsb-dropdown-menu .dsb-suggestion { + cursor: pointer; +} +.meilisearch-autocomplete + .dsb-dropdown-menu + .dsb-suggestion.dsb-cursor + .docs-searchbar-suggestion.suggestion-layout-simple { + background-color: rgba(69, 142, 225, 0.05); +} +.meilisearch-autocomplete + .dsb-dropdown-menu + .dsb-suggestion.dsb-cursor + .docs-searchbar-suggestion:not(.suggestion-layout-simple) + .docs-searchbar-suggestion--content { + background-color: rgba(69, 142, 225, 0.05); +} +.meilisearch-autocomplete .dsb-dropdown-menu [class^='dsb-dataset-'] { + position: relative; + border: 1px solid #d9d9d9; + background: #fff; + border-radius: 4px; + overflow: auto; + padding: 0 8px 8px; +} +.meilisearch-autocomplete .dsb-dropdown-menu * { + box-sizing: border-box; +} +.meilisearch-autocomplete .docs-searchbar-suggestion { + display: block; + position: relative; + padding: 0 8px; + background: #fff; + color: #02060c; + overflow: hidden; +} +.meilisearch-autocomplete .docs-searchbar-suggestion--highlight { + color: #174d8c; + background: rgba(143, 187, 237, 0.1); + padding: 0 0.05em; +} +.meilisearch-autocomplete + .docs-searchbar-suggestion--category-header + .docs-searchbar-suggestion--category-header-lvl0 + .docs-searchbar-suggestion--highlight, +.meilisearch-autocomplete + .docs-searchbar-suggestion--category-header + .docs-searchbar-suggestion--category-header-lvl1 + .docs-searchbar-suggestion--highlight, +.meilisearch-autocomplete + .docs-searchbar-suggestion--text + .docs-searchbar-suggestion--highlight { + padding: 0 0 1px; + background: inherit; + box-shadow: inset 0 -2px 0 0 rgba(69, 142, 225, 0.8); + color: inherit; +} +.meilisearch-autocomplete .docs-searchbar-suggestion--content { + display: block; + width: 70%; + position: relative; + padding: 5.3333333333px 0 5.3333333333px 10.6666666667px; + cursor: pointer; +} +.meilisearch-autocomplete .docs-searchbar-suggestion--content:before { + content: ''; + position: absolute; + display: block; + top: 0; + height: 100%; + width: 1px; + background: #ddd; + left: -1px; } - -/* Main category */ .meilisearch-autocomplete .docs-searchbar-suggestion--category-header { + position: relative; + border-bottom: 1px solid #ddd; display: none; - font-size: var(--ifm-h2-font-size); - color: var(--ifm-heading-color); - font-family: var(--ifm-heading-font-family); - font-weight: var(--ifm-heading-font-weight); + margin-top: 8px; + padding: 4px 0; + font-size: 1em; + color: #33363d; +} +.meilisearch-autocomplete .docs-searchbar-suggestion--wrapper { + width: 100%; + display: flex; + align-items: flex-start; + padding: 8px 0 0; +} +.meilisearch-autocomplete .docs-searchbar-suggestion--subcategory-column { + width: 30%; + text-align: right; + position: relative; + padding: 5.3333333333px 10.6666666667px; + color: #a4a7ae; + font-size: 0.9em; + word-wrap: break-word; } - -/* Only show the first category */ .meilisearch-autocomplete - .docs-searchbar-suggestion.docs-searchbar-suggestion__main - .docs-searchbar-suggestion--category-header { + .docs-searchbar-suggestion--subcategory-column:before { + content: ''; + position: absolute; display: block; + top: 0; + height: 100%; + width: 1px; + background: #ddd; + right: 0; } - -/* Category Column */ -.meilisearch-autocomplete .docs-searchbar-suggestion--subcategory-column { +.meilisearch-autocomplete .docs-searchbar-suggestion--subcategory-inline { display: none; } - -/* Category Inline */ -.meilisearch-autocomplete .docs-searchbar-suggestion--subcategory-inline { - font-size: var(--ifm-h4-font-size); - color: var(--ifm-font-color-base); - font-family: var(--ifm-heading-font-family); - font-weight: var(--ifm-heading-font-weight); - margin-top: 0.5em; -} - -/* Title */ .meilisearch-autocomplete .docs-searchbar-suggestion--title { - /* font-weight: bold; */ - font-size: var(--ifm-h5-font-size); - color: var(--ifm-font-color-base); - font-family: var(--ifm-heading-font-family); - font-weight: var(--ifm-heading-font-weight); - margin-top: 0.5em; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; + margin-bottom: 4px; + color: #02060c; + font-size: 0.9em; + font-weight: 700; } - -/* Description */ .meilisearch-autocomplete .docs-searchbar-suggestion--text { - font-style: italic; - color: var(--ifm-font-color-base); + display: block; + line-height: 1.2em; + font-size: 0.85em; + color: #63676d; } - -/* Highlighted text */ -.meilisearch-autocomplete .docs-searchbar-suggestion--highlight { - background-color: var(--ifm-code-background); - border-radius: var(--ifm-code-border-radius); - padding: var(--ifm-code-padding-vertical) 0; +.meilisearch-autocomplete .docs-searchbar-suggestion--no-results { + width: 100%; + padding: 8px 0; + text-align: center; + font-size: 1.2em; +} +.meilisearch-autocomplete .docs-searchbar-suggestion--no-results:before { + display: none; +} +.meilisearch-autocomplete .docs-searchbar-suggestion code { + padding: 1px 5px; + font-size: 90%; + border: none; + color: #222; + background-color: #ebebeb; + border-radius: 3px; + font-family: Menlo, Monaco, Consolas, Courier New, monospace; +} +.meilisearch-autocomplete + .docs-searchbar-suggestion + code + .docs-searchbar-suggestion--highlight { + background: none; +} +.meilisearch-autocomplete + .docs-searchbar-suggestion.docs-searchbar-suggestion__main + .docs-searchbar-suggestion--category-header, +.meilisearch-autocomplete + .docs-searchbar-suggestion.docs-searchbar-suggestion__secondary { + display: block; +} +@media (min-width: 768px) { + .meilisearch-autocomplete + .docs-searchbar-suggestion + .docs-searchbar-suggestion--subcategory-column { + display: block; + } +} +@media (max-width: 768px) { + .meilisearch-autocomplete + .docs-searchbar-suggestion + .docs-searchbar-suggestion--subcategory-column { + display: inline-block; + width: auto; + text-align: left; + padding: 0; + font-size: 0.9em; + font-weight: 700; + opacity: 0.5; + color: #02060c; + } + .meilisearch-autocomplete + .docs-searchbar-suggestion + .docs-searchbar-suggestion--subcategory-column:before { + display: none; + } + .meilisearch-autocomplete + .docs-searchbar-suggestion + .docs-searchbar-suggestion--subcategory-column:after { + content: '|'; + } + .meilisearch-autocomplete + .docs-searchbar-suggestion + .docs-searchbar-suggestion--content { + display: inline-block; + width: auto; + text-align: left; + padding: 0; + } + .meilisearch-autocomplete + .docs-searchbar-suggestion + .docs-searchbar-suggestion--content:before { + display: none; + } +} +.meilisearch-autocomplete .suggestion-layout-simple.docs-searchbar-suggestion { + border-bottom: 1px solid #eee; + padding: 8px; + margin: 0; +} +.meilisearch-autocomplete + .suggestion-layout-simple + .docs-searchbar-suggestion--content { + width: 100%; + padding: 0; +} +.meilisearch-autocomplete + .suggestion-layout-simple + .docs-searchbar-suggestion--content:before { + display: none; +} +.meilisearch-autocomplete + .suggestion-layout-simple + .docs-searchbar-suggestion--category-header { + margin: 0; + padding: 0; + display: block; + width: 100%; + border: none; +} +.meilisearch-autocomplete + .suggestion-layout-simple + .docs-searchbar-suggestion--category-header-lvl0, +.meilisearch-autocomplete + .suggestion-layout-simple + .docs-searchbar-suggestion--category-header-lvl1 { + opacity: 0.6; + font-size: 0.85em; +} +.meilisearch-autocomplete + .suggestion-layout-simple + .docs-searchbar-suggestion--category-header-lvl1:before { + background-image: url('data:image/svg+xml;utf8,'); + content: ''; + width: 10px; + height: 10px; + display: inline-block; +} +.meilisearch-autocomplete + .suggestion-layout-simple + .docs-searchbar-suggestion--wrapper { + width: 100%; + margin: 0; + padding: 0; +} +.meilisearch-autocomplete + .suggestion-layout-simple + .docs-searchbar-suggestion--duplicate-content, +.meilisearch-autocomplete + .suggestion-layout-simple + .docs-searchbar-suggestion--subcategory-inline { + display: none; +} +.meilisearch-autocomplete + .suggestion-layout-simple + .docs-searchbar-suggestion--title { + margin: 0; + color: #458ee1; + font-size: 0.9em; + font-weight: 400; +} +.meilisearch-autocomplete + .suggestion-layout-simple + .docs-searchbar-suggestion--title:before { + content: '#'; + font-weight: 700; + color: #458ee1; + display: inline-block; +} +.meilisearch-autocomplete + .suggestion-layout-simple + .docs-searchbar-suggestion--text { + margin: 4px 0 0; + display: block; + line-height: 1.4em; + padding: 5.3333333333px 8px; + background: #f8f8f8; + font-size: 0.85em; + opacity: 0.8; +} +.meilisearch-autocomplete + .suggestion-layout-simple + .docs-searchbar-suggestion--text + .docs-searchbar-suggestion--highlight { + color: #3f4145; + font-weight: 700; + box-shadow: none; } - -/* Footer */ .meilisearch-autocomplete .docs-searchbar-footer { - padding: var(--ifm-card-vertical-spacing) var(--ifm-card-horizontal-spacing); - text-align: end; + width: 100%; + text-align: right; + height: 20px; + z-index: 2000; + margin-top: 10.6666666667px; + color: #63676d; + margin-left: auto; } - -/* Footer's height should be smaller to be the same as the 'powered by' text */ .meilisearch-autocomplete .docs-searchbar-footer-logo { - height: 15px; + margin-bottom: 4px; +} +div[data-ds-theme='dark'] .searchbox { + display: inline-block; + position: relative; + width: 350px; + height: 32px; + white-space: nowrap; + box-sizing: border-box; + visibility: visible; +} +div[data-ds-theme='dark'] .searchbox .meilisearch-autocomplete { + display: block; + width: 100%; + height: 100%; +} +div[data-ds-theme='dark'] .searchbox__wrapper { + width: 100%; + height: 100%; + z-index: 999; + position: relative; +} +div[data-ds-theme='dark'] .searchbox input { + color: #eaeaea; + display: inline-block; + box-sizing: border-box; + transition: box-shadow 0.4s ease, background 0.4s ease; + border: 0; + border-radius: 16px; + box-shadow: inset 0 0 0 1px #686d71; + background: #444d52; + padding: 0 26px 0 32px; + width: 100%; + height: 100%; + vertical-align: middle; + white-space: normal; + font-size: 90%; + -moz-appearance: none; + appearance: none; +} +div[data-ds-theme='dark'] .searchbox input::-webkit-search-cancel-button, +div[data-ds-theme='dark'] .searchbox input::-webkit-search-decoration, +div[data-ds-theme='dark'] .searchbox input::-webkit-search-results-button, +div[data-ds-theme='dark'] .searchbox input::-webkit-search-results-decoration { + display: none; +} +div[data-ds-theme='dark'] .searchbox input:hover { + box-shadow: inset 0 0 0 1px #505356; + box-shadow: inset 0 0 0 1px #747a7e; +} +div[data-ds-theme='dark'] .searchbox input:active, +div[data-ds-theme='dark'] .searchbox input:focus { + outline: 0; + box-shadow: inset 0 0 0 1px #919598; + background: #444d52; +} +div[data-ds-theme='dark'] .searchbox input::-moz-placeholder { + color: #bbb; +} +div[data-ds-theme='dark'] .searchbox input::placeholder { + color: #bbb; +} +div[data-ds-theme='dark'] .searchbox__submit { + position: absolute; + top: 0; + margin: 0; + border: 0; + border-radius: 16px 0 0 16px; + background-color: rgba(69, 142, 225, 0); + padding: 0; + width: 32px; + height: 100%; + vertical-align: middle; + text-align: center; + font-size: inherit; + -moz-user-select: none; + user-select: none; + right: inherit; + left: 0; +} +div[data-ds-theme='dark'] .searchbox__submit:before { + display: inline-block; + margin-right: -4px; + height: 100%; + vertical-align: middle; + content: ''; +} +div[data-ds-theme='dark'] .searchbox__submit:active, +div[data-ds-theme='dark'] .searchbox__submit:hover { + cursor: pointer; +} +div[data-ds-theme='dark'] .searchbox__submit:focus { + outline: 0; +} +div[data-ds-theme='dark'] .searchbox__submit svg { + width: 14px; + height: 14px; + vertical-align: middle; + fill: #6d7e96; +} +div[data-ds-theme='dark'] .searchbox__reset { + display: block; + position: absolute; + top: 5px; + right: 5px; + margin: 0; + border: 0; + background: none; + cursor: pointer; + padding: 0; + font-size: inherit; + -moz-user-select: none; + user-select: none; + fill: rgba(0, 0, 0, 0.5); +} +div[data-ds-theme='dark'] .searchbox__reset.hide { + display: none; +} +div[data-ds-theme='dark'] .searchbox__reset:focus { + outline: 0; +} +div[data-ds-theme='dark'] .searchbox__reset svg { + display: block; + margin: 4px; + width: 14px; + height: 14px; +} +div[data-ds-theme='dark'] + .searchbox__input:valid + ~ div[data-ds-theme='dark'] + .searchbox__reset { + display: block; + animation-name: sbx-reset-in; + animation-duration: 0.15s; +} +@keyframes sbx-reset-in { + 0% { + transform: translate3d(-20%, 0, 0); + opacity: 0; + } + to { + transform: none; + opacity: 1; + } +} +div[data-ds-theme='dark'] + .meilisearch-autocomplete.meilisearch-autocomplete-right + .dsb-dropdown-menu { + right: 0; + left: inherit; +} +div[data-ds-theme='dark'] + .meilisearch-autocomplete.meilisearch-autocomplete-right + .dsb-dropdown-menu:before { + right: 48px; +} +div[data-ds-theme='dark'] + .meilisearch-autocomplete.meilisearch-autocomplete-left + .dsb-dropdown-menu { + left: 0; + right: inherit; +} +div[data-ds-theme='dark'] + .meilisearch-autocomplete.meilisearch-autocomplete-left + .dsb-dropdown-menu:before { + left: 48px; +} +div[data-ds-theme='dark'] .meilisearch-autocomplete .dsb-dropdown-menu { + position: relative; + top: -6px; + border-radius: 4px; + margin: 6px 0 0; + padding: 0; + text-align: left; + height: auto; + background: transparent; + border: none; + z-index: 999; + max-width: 600px; + min-width: 500px; + box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.2), 0 2px 3px 0 rgba(0, 0, 0, 0.1); +} +div[data-ds-theme='dark'] .meilisearch-autocomplete .dsb-dropdown-menu:before { + display: block; + position: absolute; + content: ''; + width: 14px; + height: 14px; + background: #2c363e; + z-index: 1000; + top: -7px; + border-top: 1px solid #5b6369; + border-right: 1px solid #5b6369; + transform: rotate(-45deg); + border-radius: 2px; +} +div[data-ds-theme='dark'] + .meilisearch-autocomplete + .dsb-dropdown-menu + .dsb-suggestions { + position: relative; + z-index: 1000; + margin-top: 8px; +} +div[data-ds-theme='dark'] + .meilisearch-autocomplete + .dsb-dropdown-menu + .dsb-suggestions + a:hover { + text-decoration: none; +} +div[data-ds-theme='dark'] + .meilisearch-autocomplete + .dsb-dropdown-menu + .dsb-suggestion { + cursor: pointer; +} +div[data-ds-theme='dark'] + .meilisearch-autocomplete + .dsb-dropdown-menu + .dsb-suggestion.dsb-cursor + .docs-searchbar-suggestion.suggestion-layout-simple { + background-color: rgba(69, 142, 225, 0.5); +} +div[data-ds-theme='dark'] + .meilisearch-autocomplete + .dsb-dropdown-menu + .dsb-suggestion.dsb-cursor + .docs-searchbar-suggestion:not(.suggestion-layout-simple) + .docs-searchbar-suggestion--content { + background-color: rgba(69, 142, 225, 0.5); +} +div[data-ds-theme='dark'] + .meilisearch-autocomplete + .dsb-dropdown-menu + [class^='dsb-dataset-'] { + position: relative; + border: 1px solid #5b6369; + background: #2c363e; + border-radius: 4px; + overflow: auto; + padding: 0 8px 8px; +} +div[data-ds-theme='dark'] .meilisearch-autocomplete .dsb-dropdown-menu * { + box-sizing: border-box; +} +div[data-ds-theme='dark'] .meilisearch-autocomplete .docs-searchbar-suggestion { + display: block; + position: relative; + padding: 0 8px; + background: #2c363e; + color: #eaeaea; + overflow: hidden; +} +div[data-ds-theme='dark'] + .meilisearch-autocomplete + .docs-searchbar-suggestion--highlight { + color: #174d8c; + background: rgba(143, 187, 237, 0.1); + padding: 0 0.05em; + color: #9dc3ef; +} +div[data-ds-theme='dark'] + .meilisearch-autocomplete + .docs-searchbar-suggestion--category-header + .docs-searchbar-suggestion--category-header-lvl0 + .docs-searchbar-suggestion--highlight, +div[data-ds-theme='dark'] + .meilisearch-autocomplete + .docs-searchbar-suggestion--category-header + .docs-searchbar-suggestion--category-header-lvl1 + .docs-searchbar-suggestion--highlight { + padding: 0 0 1px; + background: inherit; + box-shadow: inset 0 -2px 0 0 rgba(69, 142, 225, 0.8); + color: inherit; +} +div[data-ds-theme='dark'] + .meilisearch-autocomplete + .docs-searchbar-suggestion--text + .docs-searchbar-suggestion--highlight { + padding: 0 0 1px; + background: inherit; + box-shadow: inset 0 -2px 0 0 rgba(69, 142, 225, 0.8); + color: inherit; +} +div[data-ds-theme='dark'] + .meilisearch-autocomplete + .docs-searchbar-suggestion--content { + display: block; + width: 70%; + position: relative; + padding: 5.3333333333px 0 5.3333333333px 10.6666666667px; + cursor: pointer; +} +div[data-ds-theme='dark'] + .meilisearch-autocomplete + .docs-searchbar-suggestion--content:before { + content: ''; + position: absolute; + display: block; + top: 0; + height: 100%; + width: 1px; + background: #ddd; + left: -1px; +} +div[data-ds-theme='dark'] + .meilisearch-autocomplete + .docs-searchbar-suggestion--category-header { + position: relative; + border-bottom: 1px solid #ddd; + display: none; + margin-top: 8px; + padding: 4px 0; + font-size: 1em; + color: #7db0ea; + color: #d5d5d5; +} +div[data-ds-theme='dark'] + .meilisearch-autocomplete + .docs-searchbar-suggestion--wrapper { + width: 100%; + display: flex; + align-items: flex-start; + padding: 8px 0 0; +} +div[data-ds-theme='dark'] + .meilisearch-autocomplete + .docs-searchbar-suggestion--subcategory-column { + width: 30%; + text-align: right; + position: relative; + padding: 5.3333333333px 10.6666666667px; + color: #bbb; + font-size: 0.9em; + word-wrap: break-word; +} +div[data-ds-theme='dark'] + .meilisearch-autocomplete + .docs-searchbar-suggestion--subcategory-column:before { + content: ''; + position: absolute; + display: block; + top: 0; + height: 100%; + width: 1px; + background: #ddd; + right: 0; +} +div[data-ds-theme='dark'] + .meilisearch-autocomplete + .docs-searchbar-suggestion--subcategory-inline { + display: none; +} +div[data-ds-theme='dark'] + .meilisearch-autocomplete + .docs-searchbar-suggestion--title { + margin-bottom: 4px; + color: #eaeaea; + font-size: 0.9em; + font-weight: 700; +} +div[data-ds-theme='dark'] + .meilisearch-autocomplete + .docs-searchbar-suggestion--text { + display: block; + line-height: 1.2em; + font-size: 0.85em; + color: #eaeaea; +} +div[data-ds-theme='dark'] + .meilisearch-autocomplete + .docs-searchbar-suggestion--no-results { + width: 100%; + padding: 8px 0; + text-align: center; + font-size: 1.2em; +} +div[data-ds-theme='dark'] + .meilisearch-autocomplete + .docs-searchbar-suggestion--no-results:before { + display: none; +} +div[data-ds-theme='dark'] + .meilisearch-autocomplete + .docs-searchbar-suggestion + code { + padding: 1px 5px; + font-size: 90%; + border: none; + color: #222; + background-color: #ebebeb; + border-radius: 3px; + font-family: Menlo, Monaco, Consolas, Courier New, monospace; +} +div[data-ds-theme='dark'] + .meilisearch-autocomplete + .docs-searchbar-suggestion + code + .docs-searchbar-suggestion--highlight { + background: none; +} +div[data-ds-theme='dark'] + .meilisearch-autocomplete + .docs-searchbar-suggestion.docs-searchbar-suggestion__main + .docs-searchbar-suggestion--category-header { + display: block; +} +div[data-ds-theme='dark'] + .meilisearch-autocomplete + .docs-searchbar-suggestion.docs-searchbar-suggestion__secondary { + display: block; +} +@media (min-width: 768px) { + div[data-ds-theme='dark'] + .meilisearch-autocomplete + .docs-searchbar-suggestion + .docs-searchbar-suggestion--subcategory-column { + display: block; + } +} +@media (max-width: 768px) { + div[data-ds-theme='dark'] + .meilisearch-autocomplete + .docs-searchbar-suggestion + .docs-searchbar-suggestion--subcategory-column { + display: inline-block; + width: auto; + text-align: left; + padding: 0; + font-size: 0.9em; + font-weight: 700; + opacity: 0.5; + color: #02060c; + color: #bbb; + opacity: unset; + } + div[data-ds-theme='dark'] + .meilisearch-autocomplete + .docs-searchbar-suggestion + .docs-searchbar-suggestion--subcategory-column:before { + display: none; + } + div[data-ds-theme='dark'] + .meilisearch-autocomplete + .docs-searchbar-suggestion + .docs-searchbar-suggestion--subcategory-column:after { + content: '|'; + } + div[data-ds-theme='dark'] + .meilisearch-autocomplete + .docs-searchbar-suggestion + .docs-searchbar-suggestion--content { + display: inline-block; + width: auto; + text-align: left; + padding: 0; + } + div[data-ds-theme='dark'] + .meilisearch-autocomplete + .docs-searchbar-suggestion + .docs-searchbar-suggestion--content:before { + display: none; + } +} +div[data-ds-theme='dark'] + .meilisearch-autocomplete + .suggestion-layout-simple.docs-searchbar-suggestion { + padding: 8px; + margin: 0; + border-bottom: 1px solid #737d84; +} +div[data-ds-theme='dark'] + .meilisearch-autocomplete + .suggestion-layout-simple + .docs-searchbar-suggestion--content { + width: 100%; + padding: 0; +} +div[data-ds-theme='dark'] + .meilisearch-autocomplete + .suggestion-layout-simple + .docs-searchbar-suggestion--content:before { + display: none; +} +div[data-ds-theme='dark'] + .meilisearch-autocomplete + .suggestion-layout-simple + .docs-searchbar-suggestion--category-header { + margin: 0; + padding: 0; + display: block; + width: 100%; + border: none; +} +div[data-ds-theme='dark'] + .meilisearch-autocomplete + .suggestion-layout-simple + .docs-searchbar-suggestion--category-header-lvl0, +div[data-ds-theme='dark'] + .meilisearch-autocomplete + .suggestion-layout-simple + .docs-searchbar-suggestion--category-header-lvl1 { + opacity: 0.6; + font-size: 0.85em; + opacity: unset; + color: #d5d5d5; +} +div[data-ds-theme='dark'] + .meilisearch-autocomplete + .suggestion-layout-simple + .docs-searchbar-suggestion--category-header-lvl1:before { + background-image: url('data:image/svg+xml;utf8,'); + content: ''; + width: 10px; + height: 10px; + display: inline-block; + filter: invert(1); +} +div[data-ds-theme='dark'] + .meilisearch-autocomplete + .suggestion-layout-simple + .docs-searchbar-suggestion--wrapper { + width: 100%; + margin: 0; + padding: 0; +} +div[data-ds-theme='dark'] + .meilisearch-autocomplete + .suggestion-layout-simple + .docs-searchbar-suggestion--duplicate-content, +div[data-ds-theme='dark'] + .meilisearch-autocomplete + .suggestion-layout-simple + .docs-searchbar-suggestion--subcategory-inline { + display: none; +} +div[data-ds-theme='dark'] + .meilisearch-autocomplete + .suggestion-layout-simple + .docs-searchbar-suggestion--title { + margin: 0; + color: #458ee1; + font-size: 0.9em; + font-weight: 400; + color: #eaeaea; +} +div[data-ds-theme='dark'] + .meilisearch-autocomplete + .suggestion-layout-simple + .docs-searchbar-suggestion--title:before { + content: '#'; + font-weight: 700; + color: #458ee1; + display: inline-block; + color: #eaeaea; +} +div[data-ds-theme='dark'] + .meilisearch-autocomplete + .suggestion-layout-simple + .docs-searchbar-suggestion--text { + margin: 4px 0 0; + display: block; + line-height: 1.4em; + padding: 5.3333333333px 8px; + background: #6b7278; + font-size: 0.85em; + opacity: 0.8; +} +div[data-ds-theme='dark'] + .meilisearch-autocomplete + .suggestion-layout-simple + .docs-searchbar-suggestion--text + .docs-searchbar-suggestion--highlight { + color: #c4c4c4; + font-weight: 700; + box-shadow: none; + color: #fff; +} +div[data-ds-theme='dark'] .meilisearch-autocomplete .docs-searchbar-footer { + width: 100%; + text-align: right; + height: 20px; + z-index: 2000; + margin-top: 10.6666666667px; + color: #eaeaea; + margin-left: auto; } - -[data-theme='dark'] .meilisearch-autocomplete .docs-searchbar-footer-logo { - filter: invert(); +div[data-ds-theme='dark'] + .meilisearch-autocomplete + .docs-searchbar-footer-logo { + margin-bottom: 4px; + filter: invert(1); } +/*# sourceMappingURL=docs-searchbar.min.css.map */ From 75906853071b0315d9186bebd0edcbf21deff103 Mon Sep 17 00:00:00 2001 From: FabianLars Date: Thu, 26 Jan 2023 19:15:38 +0100 Subject: [PATCH 06/16] throw together some fixes for our custom css --- src/theme/SearchBar/style.css | 1102 +++------------------------------ 1 file changed, 82 insertions(+), 1020 deletions(-) diff --git a/src/theme/SearchBar/style.css b/src/theme/SearchBar/style.css index 4e40233b34..3b07797de8 100644 --- a/src/theme/SearchBar/style.css +++ b/src/theme/SearchBar/style.css @@ -1,241 +1,48 @@ -.searchbox { - display: inline-block; - position: relative; - width: 200px; - height: 32px; - white-space: nowrap; - box-sizing: border-box; - visibility: visible; -} -.searchbox .meilisearch-autocomplete { - display: block; - width: 100%; - height: 100%; -} -.searchbox__wrapper { - width: 100%; - height: 100%; - z-index: 999; - position: relative; -} -.searchbox input { - color: #555; - display: inline-block; - box-sizing: border-box; - transition: box-shadow 0.4s ease, background 0.4s ease; - border: 0; - border-radius: 16px; - box-shadow: inset 0 0 0 1px #ccc; - background: #fff; - padding: 0 26px 0 32px; - width: 100%; - height: 100%; - vertical-align: middle; - white-space: normal; - font-size: 12px; - -moz-appearance: none; - appearance: none; -} -.searchbox input::-webkit-search-cancel-button, -.searchbox input::-webkit-search-decoration, -.searchbox input::-webkit-search-results-button, -.searchbox input::-webkit-search-results-decoration { - display: none; -} -.searchbox input:hover { - box-shadow: inset 0 0 0 1px #b3b3b3; -} -.searchbox input:active, -.searchbox input:focus { - outline: 0; - box-shadow: inset 0 0 0 1px #aaa; - background: #fff; -} -.searchbox input::-moz-placeholder { - color: #aaa; -} -.searchbox input::placeholder { - color: #aaa; -} -.searchbox__submit { - position: absolute; - top: 0; - margin: 0; - border: 0; - border-radius: 16px 0 0 16px; - background-color: rgba(69, 142, 225, 0); - padding: 0; - width: 32px; - height: 100%; - vertical-align: middle; - text-align: center; - font-size: inherit; - -moz-user-select: none; - user-select: none; - right: inherit; - left: 0; -} -.searchbox__submit:before { - display: inline-block; - margin-right: -4px; - height: 100%; - vertical-align: middle; - content: ''; -} -.searchbox__submit:active, -.searchbox__submit:hover { - cursor: pointer; -} -.searchbox__submit:focus { - outline: 0; -} -.searchbox__submit svg { - width: 14px; - height: 14px; - vertical-align: middle; - fill: #6d7e96; -} -.searchbox__reset { - display: block; - position: absolute; - top: 8px; - right: 8px; - margin: 0; - border: 0; - background: none; - cursor: pointer; - padding: 0; - font-size: inherit; - -moz-user-select: none; - user-select: none; - fill: rgba(0, 0, 0, 0.5); -} -.searchbox__reset.hide { - display: none; -} -.searchbox__reset:focus { - outline: 0; -} -.searchbox__reset svg { - display: block; - margin: 4px; - width: 8px; - height: 8px; -} -.searchbox__input:valid ~ .searchbox__reset { - display: block; - animation-name: sbx-reset-in; - animation-duration: 0.15s; -} -.meilisearch-autocomplete.meilisearch-autocomplete-right .dsb-dropdown-menu { - right: 0; - left: inherit; -} -.meilisearch-autocomplete.meilisearch-autocomplete-right - .dsb-dropdown-menu:before { - right: 48px; -} -.meilisearch-autocomplete.meilisearch-autocomplete-left .dsb-dropdown-menu { - left: 0; - right: inherit; -} -.meilisearch-autocomplete.meilisearch-autocomplete-left - .dsb-dropdown-menu:before { - left: 48px; +/* Prevents zooming in on mobile */ +@media screen and (max-width: 996px) { + input#search-bar-input { + font-size: 16px !important; + } } + +/* Main dropdown wrapper */ .meilisearch-autocomplete .dsb-dropdown-menu { - position: relative; - top: -6px; - border-radius: 4px; - margin: 6px 0 0; - padding: 0; - text-align: left; - height: auto; - background: transparent; - border: none; - z-index: 999; - max-width: 600px; - min-width: 500px; - box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.2), 0 2px 3px 0 rgba(0, 0, 0, 0.1); -} -.meilisearch-autocomplete .dsb-dropdown-menu:before { - display: block; - position: absolute; - content: ''; - width: 14px; - height: 14px; - background: #fff; - z-index: 1000; - top: -7px; - border-top: 1px solid #d9d9d9; - border-right: 1px solid #d9d9d9; - transform: rotate(-45deg); - border-radius: 2px; -} -.meilisearch-autocomplete .dsb-dropdown-menu .dsb-suggestions { - position: relative; - z-index: 1000; - margin-top: 8px; -} -.meilisearch-autocomplete .dsb-dropdown-menu .dsb-suggestions a:hover { + background-color: var(--ifm-card-background-color); + border-radius: var(--ifm-card-border-radius); + box-shadow: var(--ifm-global-shadow-md); + max-height: calc(100vh - var(--ifm-navbar-height)); + width: min(calc(90vw - var(--ifm-navbar-padding-horizontal)), 35rem); + z-index: unset !important; + right: 0; + overflow-y: scroll; +} + +/* Content */ +.meilisearch-autocomplete .dsb-suggestions, +.docs-searchbar-suggestion--no-results { + padding: var(--ifm-card-vertical-spacing) var(--ifm-card-horizontal-spacing); +} + +/* A single suggestion */ +.meilisearch-autocomplete .dsb-suggestion { + padding: 0.25rem 0.5rem; text-decoration: none; + border-radius: 0.5rem; } -.meilisearch-autocomplete .dsb-dropdown-menu .dsb-suggestion { - cursor: pointer; -} -.meilisearch-autocomplete - .dsb-dropdown-menu - .dsb-suggestion.dsb-cursor - .docs-searchbar-suggestion.suggestion-layout-simple { - background-color: rgba(69, 142, 225, 0.05); -} -.meilisearch-autocomplete - .dsb-dropdown-menu - .dsb-suggestion.dsb-cursor - .docs-searchbar-suggestion:not(.suggestion-layout-simple) - .docs-searchbar-suggestion--content { - background-color: rgba(69, 142, 225, 0.05); -} -.meilisearch-autocomplete .dsb-dropdown-menu [class^='dsb-dataset-'] { - position: relative; - border: 1px solid #d9d9d9; - background: #fff; - border-radius: 4px; - overflow: auto; - padding: 0 8px 8px; -} -.meilisearch-autocomplete .dsb-dropdown-menu * { - box-sizing: border-box; -} + .meilisearch-autocomplete .docs-searchbar-suggestion { display: block; position: relative; padding: 0 8px; - background: #fff; - color: #02060c; overflow: hidden; } -.meilisearch-autocomplete .docs-searchbar-suggestion--highlight { - color: #174d8c; - background: rgba(143, 187, 237, 0.1); - padding: 0 0.05em; -} -.meilisearch-autocomplete - .docs-searchbar-suggestion--category-header - .docs-searchbar-suggestion--category-header-lvl0 - .docs-searchbar-suggestion--highlight, -.meilisearch-autocomplete - .docs-searchbar-suggestion--category-header - .docs-searchbar-suggestion--category-header-lvl1 - .docs-searchbar-suggestion--highlight, -.meilisearch-autocomplete - .docs-searchbar-suggestion--text - .docs-searchbar-suggestion--highlight { - padding: 0 0 1px; - background: inherit; - box-shadow: inset 0 -2px 0 0 rgba(69, 142, 225, 0.8); - color: inherit; + +.meilisearch-autocomplete .dsb-suggestion:hover, +.meilisearch-autocomplete .dsb-suggestion.dsb-cursor { + background-color: var(--ifm-dropdown-hover-background-color); + color: var(--ifm-dropdown-link-color); } + .meilisearch-autocomplete .docs-searchbar-suggestion--content { display: block; width: 70%; @@ -253,827 +60,82 @@ background: #ddd; left: -1px; } -.meilisearch-autocomplete .docs-searchbar-suggestion--category-header { - position: relative; - border-bottom: 1px solid #ddd; - display: none; - margin-top: 8px; - padding: 4px 0; - font-size: 1em; - color: #33363d; -} + .meilisearch-autocomplete .docs-searchbar-suggestion--wrapper { width: 100%; display: flex; align-items: flex-start; padding: 8px 0 0; } -.meilisearch-autocomplete .docs-searchbar-suggestion--subcategory-column { - width: 30%; - text-align: right; - position: relative; - padding: 5.3333333333px 10.6666666667px; - color: #a4a7ae; - font-size: 0.9em; - word-wrap: break-word; -} -.meilisearch-autocomplete - .docs-searchbar-suggestion--subcategory-column:before { - content: ''; - position: absolute; - display: block; - top: 0; - height: 100%; - width: 1px; - background: #ddd; - right: 0; -} -.meilisearch-autocomplete .docs-searchbar-suggestion--subcategory-inline { - display: none; -} -.meilisearch-autocomplete .docs-searchbar-suggestion--title { - margin-bottom: 4px; - color: #02060c; - font-size: 0.9em; - font-weight: 700; -} -.meilisearch-autocomplete .docs-searchbar-suggestion--text { - display: block; - line-height: 1.2em; - font-size: 0.85em; - color: #63676d; -} -.meilisearch-autocomplete .docs-searchbar-suggestion--no-results { - width: 100%; - padding: 8px 0; - text-align: center; - font-size: 1.2em; -} -.meilisearch-autocomplete .docs-searchbar-suggestion--no-results:before { + +/* Main category */ +.meilisearch-autocomplete .docs-searchbar-suggestion--category-header { display: none; + font-size: var(--ifm-h3-font-size); + color: var(--ifm-heading-color); + font-family: var(--ifm-heading-font-family); + font-weight: var(--ifm-heading-font-weight); + border-bottom: 1px solid #ddd; } -.meilisearch-autocomplete .docs-searchbar-suggestion code { - padding: 1px 5px; - font-size: 90%; - border: none; - color: #222; - background-color: #ebebeb; - border-radius: 3px; - font-family: Menlo, Monaco, Consolas, Courier New, monospace; -} -.meilisearch-autocomplete - .docs-searchbar-suggestion - code - .docs-searchbar-suggestion--highlight { - background: none; -} + +/* Only show the first category */ .meilisearch-autocomplete .docs-searchbar-suggestion.docs-searchbar-suggestion__main - .docs-searchbar-suggestion--category-header, -.meilisearch-autocomplete - .docs-searchbar-suggestion.docs-searchbar-suggestion__secondary { - display: block; -} -@media (min-width: 768px) { - .meilisearch-autocomplete - .docs-searchbar-suggestion - .docs-searchbar-suggestion--subcategory-column { - display: block; - } -} -@media (max-width: 768px) { - .meilisearch-autocomplete - .docs-searchbar-suggestion - .docs-searchbar-suggestion--subcategory-column { - display: inline-block; - width: auto; - text-align: left; - padding: 0; - font-size: 0.9em; - font-weight: 700; - opacity: 0.5; - color: #02060c; - } - .meilisearch-autocomplete - .docs-searchbar-suggestion - .docs-searchbar-suggestion--subcategory-column:before { - display: none; - } - .meilisearch-autocomplete - .docs-searchbar-suggestion - .docs-searchbar-suggestion--subcategory-column:after { - content: '|'; - } - .meilisearch-autocomplete - .docs-searchbar-suggestion - .docs-searchbar-suggestion--content { - display: inline-block; - width: auto; - text-align: left; - padding: 0; - } - .meilisearch-autocomplete - .docs-searchbar-suggestion - .docs-searchbar-suggestion--content:before { - display: none; - } -} -.meilisearch-autocomplete .suggestion-layout-simple.docs-searchbar-suggestion { - border-bottom: 1px solid #eee; - padding: 8px; - margin: 0; -} -.meilisearch-autocomplete - .suggestion-layout-simple - .docs-searchbar-suggestion--content { - width: 100%; - padding: 0; -} -.meilisearch-autocomplete - .suggestion-layout-simple - .docs-searchbar-suggestion--content:before { - display: none; -} -.meilisearch-autocomplete - .suggestion-layout-simple .docs-searchbar-suggestion--category-header { - margin: 0; - padding: 0; display: block; - width: 100%; - border: none; -} -.meilisearch-autocomplete - .suggestion-layout-simple - .docs-searchbar-suggestion--category-header-lvl0, -.meilisearch-autocomplete - .suggestion-layout-simple - .docs-searchbar-suggestion--category-header-lvl1 { - opacity: 0.6; - font-size: 0.85em; -} -.meilisearch-autocomplete - .suggestion-layout-simple - .docs-searchbar-suggestion--category-header-lvl1:before { - background-image: url('data:image/svg+xml;utf8,'); - content: ''; - width: 10px; - height: 10px; - display: inline-block; } -.meilisearch-autocomplete - .suggestion-layout-simple - .docs-searchbar-suggestion--wrapper { - width: 100%; - margin: 0; - padding: 0; -} -.meilisearch-autocomplete - .suggestion-layout-simple - .docs-searchbar-suggestion--duplicate-content, -.meilisearch-autocomplete - .suggestion-layout-simple - .docs-searchbar-suggestion--subcategory-inline { + +.meilisearch-autocomplete .docs-searchbar-suggestion--subcategory-inline { display: none; } -.meilisearch-autocomplete - .suggestion-layout-simple - .docs-searchbar-suggestion--title { - margin: 0; - color: #458ee1; - font-size: 0.9em; - font-weight: 400; -} -.meilisearch-autocomplete - .suggestion-layout-simple - .docs-searchbar-suggestion--title:before { - content: '#'; - font-weight: 700; - color: #458ee1; - display: inline-block; -} -.meilisearch-autocomplete - .suggestion-layout-simple - .docs-searchbar-suggestion--text { - margin: 4px 0 0; - display: block; - line-height: 1.4em; - padding: 5.3333333333px 8px; - background: #f8f8f8; - font-size: 0.85em; - opacity: 0.8; -} -.meilisearch-autocomplete - .suggestion-layout-simple - .docs-searchbar-suggestion--text - .docs-searchbar-suggestion--highlight { - color: #3f4145; - font-weight: 700; - box-shadow: none; -} -.meilisearch-autocomplete .docs-searchbar-footer { - width: 100%; - text-align: right; - height: 20px; - z-index: 2000; - margin-top: 10.6666666667px; - color: #63676d; - margin-left: auto; -} -.meilisearch-autocomplete .docs-searchbar-footer-logo { - margin-bottom: 4px; -} -div[data-ds-theme='dark'] .searchbox { - display: inline-block; - position: relative; - width: 350px; - height: 32px; + +/* Title */ +.meilisearch-autocomplete .docs-searchbar-suggestion--title { + /* font-weight: bold; */ + font-size: var(--ifm-h5-font-size); + color: var(--ifm-font-color-base); + font-family: var(--ifm-heading-font-family); + font-weight: var(--ifm-heading-font-weight); white-space: nowrap; - box-sizing: border-box; - visibility: visible; -} -div[data-ds-theme='dark'] .searchbox .meilisearch-autocomplete { - display: block; - width: 100%; - height: 100%; -} -div[data-ds-theme='dark'] .searchbox__wrapper { - width: 100%; - height: 100%; - z-index: 999; - position: relative; -} -div[data-ds-theme='dark'] .searchbox input { - color: #eaeaea; - display: inline-block; - box-sizing: border-box; - transition: box-shadow 0.4s ease, background 0.4s ease; - border: 0; - border-radius: 16px; - box-shadow: inset 0 0 0 1px #686d71; - background: #444d52; - padding: 0 26px 0 32px; - width: 100%; - height: 100%; - vertical-align: middle; - white-space: normal; - font-size: 90%; - -moz-appearance: none; - appearance: none; -} -div[data-ds-theme='dark'] .searchbox input::-webkit-search-cancel-button, -div[data-ds-theme='dark'] .searchbox input::-webkit-search-decoration, -div[data-ds-theme='dark'] .searchbox input::-webkit-search-results-button, -div[data-ds-theme='dark'] .searchbox input::-webkit-search-results-decoration { - display: none; -} -div[data-ds-theme='dark'] .searchbox input:hover { - box-shadow: inset 0 0 0 1px #505356; - box-shadow: inset 0 0 0 1px #747a7e; -} -div[data-ds-theme='dark'] .searchbox input:active, -div[data-ds-theme='dark'] .searchbox input:focus { - outline: 0; - box-shadow: inset 0 0 0 1px #919598; - background: #444d52; -} -div[data-ds-theme='dark'] .searchbox input::-moz-placeholder { - color: #bbb; -} -div[data-ds-theme='dark'] .searchbox input::placeholder { - color: #bbb; -} -div[data-ds-theme='dark'] .searchbox__submit { - position: absolute; - top: 0; - margin: 0; - border: 0; - border-radius: 16px 0 0 16px; - background-color: rgba(69, 142, 225, 0); - padding: 0; - width: 32px; - height: 100%; - vertical-align: middle; - text-align: center; - font-size: inherit; - -moz-user-select: none; - user-select: none; - right: inherit; - left: 0; -} -div[data-ds-theme='dark'] .searchbox__submit:before { - display: inline-block; - margin-right: -4px; - height: 100%; - vertical-align: middle; - content: ''; -} -div[data-ds-theme='dark'] .searchbox__submit:active, -div[data-ds-theme='dark'] .searchbox__submit:hover { - cursor: pointer; -} -div[data-ds-theme='dark'] .searchbox__submit:focus { - outline: 0; -} -div[data-ds-theme='dark'] .searchbox__submit svg { - width: 14px; - height: 14px; - vertical-align: middle; - fill: #6d7e96; -} -div[data-ds-theme='dark'] .searchbox__reset { - display: block; - position: absolute; - top: 5px; - right: 5px; - margin: 0; - border: 0; - background: none; - cursor: pointer; - padding: 0; - font-size: inherit; - -moz-user-select: none; - user-select: none; - fill: rgba(0, 0, 0, 0.5); -} -div[data-ds-theme='dark'] .searchbox__reset.hide { - display: none; -} -div[data-ds-theme='dark'] .searchbox__reset:focus { - outline: 0; -} -div[data-ds-theme='dark'] .searchbox__reset svg { - display: block; - margin: 4px; - width: 14px; - height: 14px; -} -div[data-ds-theme='dark'] - .searchbox__input:valid - ~ div[data-ds-theme='dark'] - .searchbox__reset { - display: block; - animation-name: sbx-reset-in; - animation-duration: 0.15s; -} -@keyframes sbx-reset-in { - 0% { - transform: translate3d(-20%, 0, 0); - opacity: 0; - } - to { - transform: none; - opacity: 1; - } -} -div[data-ds-theme='dark'] - .meilisearch-autocomplete.meilisearch-autocomplete-right - .dsb-dropdown-menu { - right: 0; - left: inherit; -} -div[data-ds-theme='dark'] - .meilisearch-autocomplete.meilisearch-autocomplete-right - .dsb-dropdown-menu:before { - right: 48px; -} -div[data-ds-theme='dark'] - .meilisearch-autocomplete.meilisearch-autocomplete-left - .dsb-dropdown-menu { - left: 0; - right: inherit; -} -div[data-ds-theme='dark'] - .meilisearch-autocomplete.meilisearch-autocomplete-left - .dsb-dropdown-menu:before { - left: 48px; -} -div[data-ds-theme='dark'] .meilisearch-autocomplete .dsb-dropdown-menu { - position: relative; - top: -6px; - border-radius: 4px; - margin: 6px 0 0; - padding: 0; - text-align: left; - height: auto; - background: transparent; - border: none; - z-index: 999; - max-width: 600px; - min-width: 500px; - box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.2), 0 2px 3px 0 rgba(0, 0, 0, 0.1); -} -div[data-ds-theme='dark'] .meilisearch-autocomplete .dsb-dropdown-menu:before { - display: block; - position: absolute; - content: ''; - width: 14px; - height: 14px; - background: #2c363e; - z-index: 1000; - top: -7px; - border-top: 1px solid #5b6369; - border-right: 1px solid #5b6369; - transform: rotate(-45deg); - border-radius: 2px; -} -div[data-ds-theme='dark'] - .meilisearch-autocomplete - .dsb-dropdown-menu - .dsb-suggestions { - position: relative; - z-index: 1000; - margin-top: 8px; -} -div[data-ds-theme='dark'] - .meilisearch-autocomplete - .dsb-dropdown-menu - .dsb-suggestions - a:hover { - text-decoration: none; -} -div[data-ds-theme='dark'] - .meilisearch-autocomplete - .dsb-dropdown-menu - .dsb-suggestion { - cursor: pointer; -} -div[data-ds-theme='dark'] - .meilisearch-autocomplete - .dsb-dropdown-menu - .dsb-suggestion.dsb-cursor - .docs-searchbar-suggestion.suggestion-layout-simple { - background-color: rgba(69, 142, 225, 0.5); -} -div[data-ds-theme='dark'] - .meilisearch-autocomplete - .dsb-dropdown-menu - .dsb-suggestion.dsb-cursor - .docs-searchbar-suggestion:not(.suggestion-layout-simple) - .docs-searchbar-suggestion--content { - background-color: rgba(69, 142, 225, 0.5); -} -div[data-ds-theme='dark'] - .meilisearch-autocomplete - .dsb-dropdown-menu - [class^='dsb-dataset-'] { - position: relative; - border: 1px solid #5b6369; - background: #2c363e; - border-radius: 4px; - overflow: auto; - padding: 0 8px 8px; -} -div[data-ds-theme='dark'] .meilisearch-autocomplete .dsb-dropdown-menu * { - box-sizing: border-box; -} -div[data-ds-theme='dark'] .meilisearch-autocomplete .docs-searchbar-suggestion { - display: block; - position: relative; - padding: 0 8px; - background: #2c363e; - color: #eaeaea; overflow: hidden; + text-overflow: ellipsis; } -div[data-ds-theme='dark'] - .meilisearch-autocomplete - .docs-searchbar-suggestion--highlight { - color: #174d8c; - background: rgba(143, 187, 237, 0.1); - padding: 0 0.05em; - color: #9dc3ef; -} -div[data-ds-theme='dark'] - .meilisearch-autocomplete - .docs-searchbar-suggestion--category-header - .docs-searchbar-suggestion--category-header-lvl0 - .docs-searchbar-suggestion--highlight, -div[data-ds-theme='dark'] - .meilisearch-autocomplete - .docs-searchbar-suggestion--category-header - .docs-searchbar-suggestion--category-header-lvl1 - .docs-searchbar-suggestion--highlight { - padding: 0 0 1px; - background: inherit; - box-shadow: inset 0 -2px 0 0 rgba(69, 142, 225, 0.8); - color: inherit; -} -div[data-ds-theme='dark'] - .meilisearch-autocomplete - .docs-searchbar-suggestion--text - .docs-searchbar-suggestion--highlight { - padding: 0 0 1px; - background: inherit; - box-shadow: inset 0 -2px 0 0 rgba(69, 142, 225, 0.8); - color: inherit; -} -div[data-ds-theme='dark'] - .meilisearch-autocomplete - .docs-searchbar-suggestion--content { - display: block; - width: 70%; - position: relative; - padding: 5.3333333333px 0 5.3333333333px 10.6666666667px; - cursor: pointer; -} -div[data-ds-theme='dark'] - .meilisearch-autocomplete - .docs-searchbar-suggestion--content:before { - content: ''; - position: absolute; - display: block; - top: 0; - height: 100%; - width: 1px; - background: #ddd; - left: -1px; -} -div[data-ds-theme='dark'] - .meilisearch-autocomplete - .docs-searchbar-suggestion--category-header { - position: relative; - border-bottom: 1px solid #ddd; - display: none; - margin-top: 8px; - padding: 4px 0; - font-size: 1em; - color: #7db0ea; - color: #d5d5d5; -} -div[data-ds-theme='dark'] - .meilisearch-autocomplete - .docs-searchbar-suggestion--wrapper { - width: 100%; - display: flex; - align-items: flex-start; - padding: 8px 0 0; -} -div[data-ds-theme='dark'] - .meilisearch-autocomplete - .docs-searchbar-suggestion--subcategory-column { + +.meilisearch-autocomplete .docs-searchbar-suggestion--subcategory-column { width: 30%; text-align: right; position: relative; padding: 5.3333333333px 10.6666666667px; - color: #bbb; + color: #a4a7ae; font-size: 0.9em; word-wrap: break-word; } -div[data-ds-theme='dark'] - .meilisearch-autocomplete - .docs-searchbar-suggestion--subcategory-column:before { - content: ''; - position: absolute; - display: block; - top: 0; - height: 100%; - width: 1px; - background: #ddd; - right: 0; -} -div[data-ds-theme='dark'] - .meilisearch-autocomplete - .docs-searchbar-suggestion--subcategory-inline { - display: none; -} -div[data-ds-theme='dark'] - .meilisearch-autocomplete - .docs-searchbar-suggestion--title { - margin-bottom: 4px; - color: #eaeaea; - font-size: 0.9em; - font-weight: 700; -} -div[data-ds-theme='dark'] - .meilisearch-autocomplete - .docs-searchbar-suggestion--text { - display: block; - line-height: 1.2em; - font-size: 0.85em; - color: #eaeaea; -} -div[data-ds-theme='dark'] - .meilisearch-autocomplete - .docs-searchbar-suggestion--no-results { - width: 100%; - padding: 8px 0; - text-align: center; - font-size: 1.2em; -} -div[data-ds-theme='dark'] - .meilisearch-autocomplete - .docs-searchbar-suggestion--no-results:before { - display: none; -} -div[data-ds-theme='dark'] - .meilisearch-autocomplete - .docs-searchbar-suggestion - code { - padding: 1px 5px; - font-size: 90%; - border: none; - color: #222; - background-color: #ebebeb; - border-radius: 3px; - font-family: Menlo, Monaco, Consolas, Courier New, monospace; -} -div[data-ds-theme='dark'] - .meilisearch-autocomplete - .docs-searchbar-suggestion - code - .docs-searchbar-suggestion--highlight { - background: none; -} -div[data-ds-theme='dark'] - .meilisearch-autocomplete - .docs-searchbar-suggestion.docs-searchbar-suggestion__main - .docs-searchbar-suggestion--category-header { - display: block; -} -div[data-ds-theme='dark'] - .meilisearch-autocomplete - .docs-searchbar-suggestion.docs-searchbar-suggestion__secondary { - display: block; -} -@media (min-width: 768px) { - div[data-ds-theme='dark'] - .meilisearch-autocomplete - .docs-searchbar-suggestion - .docs-searchbar-suggestion--subcategory-column { - display: block; - } -} -@media (max-width: 768px) { - div[data-ds-theme='dark'] - .meilisearch-autocomplete - .docs-searchbar-suggestion - .docs-searchbar-suggestion--subcategory-column { - display: inline-block; - width: auto; - text-align: left; - padding: 0; - font-size: 0.9em; - font-weight: 700; - opacity: 0.5; - color: #02060c; - color: #bbb; - opacity: unset; - } - div[data-ds-theme='dark'] - .meilisearch-autocomplete - .docs-searchbar-suggestion - .docs-searchbar-suggestion--subcategory-column:before { - display: none; - } - div[data-ds-theme='dark'] - .meilisearch-autocomplete - .docs-searchbar-suggestion - .docs-searchbar-suggestion--subcategory-column:after { - content: '|'; - } - div[data-ds-theme='dark'] - .meilisearch-autocomplete - .docs-searchbar-suggestion - .docs-searchbar-suggestion--content { - display: inline-block; - width: auto; - text-align: left; - padding: 0; - } - div[data-ds-theme='dark'] - .meilisearch-autocomplete - .docs-searchbar-suggestion - .docs-searchbar-suggestion--content:before { - display: none; - } -} -div[data-ds-theme='dark'] - .meilisearch-autocomplete - .suggestion-layout-simple.docs-searchbar-suggestion { - padding: 8px; - margin: 0; - border-bottom: 1px solid #737d84; -} -div[data-ds-theme='dark'] - .meilisearch-autocomplete - .suggestion-layout-simple - .docs-searchbar-suggestion--content { - width: 100%; - padding: 0; -} -div[data-ds-theme='dark'] - .meilisearch-autocomplete - .suggestion-layout-simple - .docs-searchbar-suggestion--content:before { - display: none; -} -div[data-ds-theme='dark'] - .meilisearch-autocomplete - .suggestion-layout-simple - .docs-searchbar-suggestion--category-header { - margin: 0; - padding: 0; - display: block; - width: 100%; - border: none; -} -div[data-ds-theme='dark'] - .meilisearch-autocomplete - .suggestion-layout-simple - .docs-searchbar-suggestion--category-header-lvl0, -div[data-ds-theme='dark'] - .meilisearch-autocomplete - .suggestion-layout-simple - .docs-searchbar-suggestion--category-header-lvl1 { - opacity: 0.6; + +/* Description */ +.meilisearch-autocomplete .docs-searchbar-suggestion--text { + font-style: italic; font-size: 0.85em; - opacity: unset; - color: #d5d5d5; -} -div[data-ds-theme='dark'] - .meilisearch-autocomplete - .suggestion-layout-simple - .docs-searchbar-suggestion--category-header-lvl1:before { - background-image: url('data:image/svg+xml;utf8,'); - content: ''; - width: 10px; - height: 10px; - display: inline-block; - filter: invert(1); -} -div[data-ds-theme='dark'] - .meilisearch-autocomplete - .suggestion-layout-simple - .docs-searchbar-suggestion--wrapper { - width: 100%; - margin: 0; - padding: 0; -} -div[data-ds-theme='dark'] - .meilisearch-autocomplete - .suggestion-layout-simple - .docs-searchbar-suggestion--duplicate-content, -div[data-ds-theme='dark'] - .meilisearch-autocomplete - .suggestion-layout-simple - .docs-searchbar-suggestion--subcategory-inline { - display: none; + color: var(--ifm-font-color-base); } -div[data-ds-theme='dark'] - .meilisearch-autocomplete - .suggestion-layout-simple - .docs-searchbar-suggestion--title { - margin: 0; - color: #458ee1; - font-size: 0.9em; - font-weight: 400; - color: #eaeaea; -} -div[data-ds-theme='dark'] - .meilisearch-autocomplete - .suggestion-layout-simple - .docs-searchbar-suggestion--title:before { - content: '#'; - font-weight: 700; - color: #458ee1; - display: inline-block; - color: #eaeaea; -} -div[data-ds-theme='dark'] - .meilisearch-autocomplete - .suggestion-layout-simple - .docs-searchbar-suggestion--text { - margin: 4px 0 0; - display: block; - line-height: 1.4em; - padding: 5.3333333333px 8px; - background: #6b7278; - font-size: 0.85em; - opacity: 0.8; + +/* Highlighted text */ +.meilisearch-autocomplete .docs-searchbar-suggestion--highlight { + background-color: var(--ifm-code-background); + border-radius: var(--ifm-code-border-radius); + padding: var(--ifm-code-padding-vertical) 0; } -div[data-ds-theme='dark'] - .meilisearch-autocomplete - .suggestion-layout-simple - .docs-searchbar-suggestion--text - .docs-searchbar-suggestion--highlight { - color: #c4c4c4; - font-weight: 700; - box-shadow: none; - color: #fff; + +/* Footer */ +.meilisearch-autocomplete .docs-searchbar-footer { + padding: var(--ifm-card-vertical-spacing) var(--ifm-card-horizontal-spacing); + text-align: end; } -div[data-ds-theme='dark'] .meilisearch-autocomplete .docs-searchbar-footer { - width: 100%; - text-align: right; - height: 20px; - z-index: 2000; - margin-top: 10.6666666667px; - color: #eaeaea; - margin-left: auto; + +/* Footer's height should be smaller to be the same as the 'powered by' text */ +.meilisearch-autocomplete .docs-searchbar-footer-logo { + height: 15px; } -div[data-ds-theme='dark'] - .meilisearch-autocomplete - .docs-searchbar-footer-logo { - margin-bottom: 4px; - filter: invert(1); + +[data-theme='dark'] .meilisearch-autocomplete .docs-searchbar-footer-logo { + filter: invert(); } -/*# sourceMappingURL=docs-searchbar.min.css.map */ From d21e5f8c953f4d206fbfec346d9fa26ee777b1d3 Mon Sep 17 00:00:00 2001 From: FabianLars Date: Thu, 26 Jan 2023 19:26:21 +0100 Subject: [PATCH 07/16] don't overflow/no-wrap title --- src/theme/SearchBar/style.css | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/theme/SearchBar/style.css b/src/theme/SearchBar/style.css index 3b07797de8..822fcf7510 100644 --- a/src/theme/SearchBar/style.css +++ b/src/theme/SearchBar/style.css @@ -96,9 +96,6 @@ color: var(--ifm-font-color-base); font-family: var(--ifm-heading-font-family); font-weight: var(--ifm-heading-font-weight); - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; } .meilisearch-autocomplete .docs-searchbar-suggestion--subcategory-column { From e2ed1e6bc69cfaf1d2fb25d313bda3d211e24409 Mon Sep 17 00:00:00 2001 From: Fabian-Lars Date: Thu, 26 Jan 2023 20:29:37 +0100 Subject: [PATCH 08/16] Delete algolia.html --- static/algolia.html | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 static/algolia.html diff --git a/static/algolia.html b/static/algolia.html deleted file mode 100644 index c49598bab8..0000000000 --- a/static/algolia.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - From 209bf09a6f21cfcdb2588e06f9c9ef67164491da Mon Sep 17 00:00:00 2001 From: Fabian-Lars Date: Thu, 26 Jan 2023 20:30:40 +0100 Subject: [PATCH 09/16] revert SearchBar/index.js changes --- src/theme/SearchBar/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/theme/SearchBar/index.js b/src/theme/SearchBar/index.js index 2dd4506e55..e9c22f17ee 100644 --- a/src/theme/SearchBar/index.js +++ b/src/theme/SearchBar/index.js @@ -6,12 +6,12 @@ export default function Component() { const DocsSearchBar = require('docs-searchbar.js').default DocsSearchBar({ - hostUrl: 'https://ms-0fcdc03da8a1-1619.fra.meilisearch.io', + hostUrl: 'https://tauri.search.studio', apiKey: - '3d2bbfaafc279147240ad562ee4d212437f1e78f0470bfab36690f0ba3a36958', + 'XZEH8BS90ee09c45215a8421c06857bcbde5c1a6797bdf4859a57a3ac1228a2b81df0994', indexUid: 'docs-v1', inputSelector: '#search-bar-input', - debug: true, + debug: process.env.NODE_ENV === 'development', }) }, []) From 357767ffb54580b3874b1f6087ba29bb7f01bb99 Mon Sep 17 00:00:00 2001 From: Fabian-Lars Date: Thu, 26 Jan 2023 20:31:03 +0100 Subject: [PATCH 10/16] typo --- src/theme/SearchBar/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/theme/SearchBar/index.js b/src/theme/SearchBar/index.js index e9c22f17ee..1a504fa5f4 100644 --- a/src/theme/SearchBar/index.js +++ b/src/theme/SearchBar/index.js @@ -6,7 +6,7 @@ export default function Component() { const DocsSearchBar = require('docs-searchbar.js').default DocsSearchBar({ - hostUrl: 'https://tauri.search.studio', + hostUrl: 'https://search.tauri.studio', apiKey: 'XZEH8BS90ee09c45215a8421c06857bcbde5c1a6797bdf4859a57a3ac1228a2b81df0994', indexUid: 'docs-v1', From 0de1a7c348ccd8dd9d35dda8b9b5907ded7dd008 Mon Sep 17 00:00:00 2001 From: FabianLars Date: Thu, 26 Jan 2023 22:06:37 +0100 Subject: [PATCH 11/16] Switch to meilisearch cloud!!! --- .github/workflows/build.yml | 4 ++-- src/theme/SearchBar/index.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 897f82489c..48b30fd1b8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -148,8 +148,8 @@ jobs: - uses: actions/checkout@v3 - name: Run scraper env: - HOST_URL: 'https://search.tauri.studio' - API_KEY: ${{ secrets.SEARCH_ADMIN_API_KEY }} + HOST_URL: ${{ secrets.MEILISEARCH_HOST_URL }} + API_KEY: ${{ secrets.MEILISEARCH_API_KEY }} CONFIG_FILE_PATH: ${{ github.workspace }}/scraper.json run: | docker run -t --rm \ diff --git a/src/theme/SearchBar/index.js b/src/theme/SearchBar/index.js index 1a504fa5f4..952f22b423 100644 --- a/src/theme/SearchBar/index.js +++ b/src/theme/SearchBar/index.js @@ -6,9 +6,9 @@ export default function Component() { const DocsSearchBar = require('docs-searchbar.js').default DocsSearchBar({ - hostUrl: 'https://search.tauri.studio', + hostUrl: 'https://ms-4ebb96f179f0-1619.fra.meilisearch.io', apiKey: - 'XZEH8BS90ee09c45215a8421c06857bcbde5c1a6797bdf4859a57a3ac1228a2b81df0994', + '3eb6db150af1abefe000f00386e149dfb5a006932cab55d1ccd810b8672a4e12', indexUid: 'docs-v1', inputSelector: '#search-bar-input', debug: process.env.NODE_ENV === 'development', From ada5030af355ce47ea85febbb0ca9fed3b83b043 Mon Sep 17 00:00:00 2001 From: Fabian-Lars Date: Fri, 27 Jan 2023 15:51:57 +0100 Subject: [PATCH 12/16] test scraper upload --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 48b30fd1b8..2e2063c80f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -142,7 +142,7 @@ jobs: update-search-index: needs: deploy-to-netlify - if: github.event_name == 'push' && github.ref_name == 'dev' + #if: github.event_name == 'push' && github.ref_name == 'dev' runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 From 51305f4acb498eed7675a52af345a61e6618ed76 Mon Sep 17 00:00:00 2001 From: Fabian-Lars Date: Fri, 27 Jan 2023 16:09:26 +0100 Subject: [PATCH 13/16] revert test --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2e2063c80f..48b30fd1b8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -142,7 +142,7 @@ jobs: update-search-index: needs: deploy-to-netlify - #if: github.event_name == 'push' && github.ref_name == 'dev' + if: github.event_name == 'push' && github.ref_name == 'dev' runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 From 654c0aeab33c6aac385117a530048ac5cddacfcf Mon Sep 17 00:00:00 2001 From: Fabian-Lars Date: Fri, 27 Jan 2023 17:10:19 +0100 Subject: [PATCH 14/16] update netlify action --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 48b30fd1b8..85eaac1dfa 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -126,7 +126,7 @@ jobs: path: build - name: Deploy to Netlify # Fork of https://github.com/nwtgck/actions-netlify for security reasons - uses: tauri-apps/actions-netlify@v1.2.4 + uses: tauri-apps/actions-netlify@v2.0.0 with: publish-dir: './build' netlify-config-path: ./netlify.toml From be8f46b8fc2fb666d8fbc17821490b66cb7bf4e1 Mon Sep 17 00:00:00 2001 From: FabianLars Date: Fri, 27 Jan 2023 18:03:12 +0100 Subject: [PATCH 15/16] line clamp --- src/theme/SearchBar/style.css | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/theme/SearchBar/style.css b/src/theme/SearchBar/style.css index 822fcf7510..eb421d5bd3 100644 --- a/src/theme/SearchBar/style.css +++ b/src/theme/SearchBar/style.css @@ -113,6 +113,12 @@ font-style: italic; font-size: 0.85em; color: var(--ifm-font-color-base); + /* Limit displayed lines of content preview to 3 */ + -webkit-line-clamp: 3; + display: -webkit-box; + text-overflow: ellipsis; + overflow: hidden; + -webkit-box-orient: vertical; } /* Highlighted text */ From 73694ddad4e4b082600fac8097e2015c3fa1efa7 Mon Sep 17 00:00:00 2001 From: FabianLars Date: Fri, 27 Jan 2023 18:57:17 +0100 Subject: [PATCH 16/16] don't include function signature in text selector --- scraper.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scraper.json b/scraper.json index c9f2ce811e..3d7ab26cb9 100644 --- a/scraper.json +++ b/scraper.json @@ -48,7 +48,7 @@ "lvl3": "article h3", "lvl4": "article h4", "lvl5": "article h5", - "text": "article p, article li" + "text": "article :not(blockquote) > p, article li" }, "references": { "lvl0": {