From ebb83a4d98ed7800d7ec8c619ab93601c7b481dd Mon Sep 17 00:00:00 2001 From: Robson Oliveira Date: Fri, 20 Oct 2023 12:07:43 -0300 Subject: [PATCH] fix(algolia): update helpcenter index and doctypes --- .github/workflows/docsearch-scraper.yml | 32 ----------------- algolia/scraper_md.json | 6 ++-- algolia/scraper_openapi.json | 40 ---------------------- src/components/search-input/index.tsx | 2 +- src/pages/updates/announcements/[slug].tsx | 2 +- 5 files changed, 5 insertions(+), 77 deletions(-) delete mode 100644 .github/workflows/docsearch-scraper.yml delete mode 100644 algolia/scraper_openapi.json diff --git a/.github/workflows/docsearch-scraper.yml b/.github/workflows/docsearch-scraper.yml deleted file mode 100644 index 8055a66e..00000000 --- a/.github/workflows/docsearch-scraper.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Devportal Scraper - -on: - pull_request: - branches: - - main - types: [closed] - -jobs: - guides-build: - runs-on: ubuntu-latest - name: Scraper running - steps: - - uses: actions/checkout@v2 - - name: Devportal Scraper - uses: vtexdocs/devportal-docsearch-action@main - with: - algolia_application_id: '${{ secrets.ALGOLIA_APP_ID }}' - algolia_api_key: ${{ secrets.ALGOLIA_WRITE_KEY }} - file: './configs/scraper_md.json' - reference-build: - runs-on: ubuntu-latest - name: Scraper running - steps: - - uses: actions/checkout@v2 - - name: Devportal Scraper - uses: vtexdocs/devportal-docsearch-action@main - with: - algolia_application_id: '${{ secrets.ALGOLIA_APP_ID }}' - algolia_api_key: ${{ secrets.ALGOLIA_WRITE_KEY }} - file: './configs/scraper_openapi.json' - needs: guides-build diff --git a/algolia/scraper_md.json b/algolia/scraper_md.json index dbabc8bd..7d2c97e2 100644 --- a/algolia/scraper_md.json +++ b/algolia/scraper_md.json @@ -1,8 +1,8 @@ { - "index_name": "devportal-docs", - "start_urls": ["https://developers.vtex.com/docs/guides"], + "index_name": "helpcenter-docs", + "start_urls": ["https://helpcenter.vtex.com/docs"], "stop_urls": [], - "sitemap_urls": ["https://developers.vtex.com/sitemap-0.xml"], + "sitemap_urls": ["https://helpcenter.vtex.com/sitemap-0.xml"], "selectors": { "lvl0": "article .title, article h1", "lvl1": "article h2", diff --git a/algolia/scraper_openapi.json b/algolia/scraper_openapi.json deleted file mode 100644 index 82b8ff66..00000000 --- a/algolia/scraper_openapi.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "index_name": "devportal-docs", - "start_urls": ["https://developers.vtex.com/docs/api-reference"], - "stop_urls": [], - "sitemap_urls": ["https://developers.vtex.com/server-sitemap.xml"], - "sitemap_urls_regexs": ["/api-reference/"], - "force_sitemap_urls_crawling": true, - "selectors": { - "lvl0": "h1", - "lvl1": "h2", - "lvl2": "h3", - "lvl3": "h4", - "lvl4": "h5", - "lvl5": { - "selector": "//div[@class='request-card'][1]/*/div[@class='param-name']", - "type": "xpath" - }, - "text": ".m-markdown p, .param-description p, .key-label" - }, - "selectors_exclude": [], - "custom_settings": { - "separatorsToIndex": "_", - "attributesForFaceting": ["doctype"], - "attributesToRetrieve": [ - "hierarchy", - "content", - "anchor", - "url", - "url_without_anchor", - "type", - "doctype" - ] - }, - "js_render": true, - "js_wait": 1, - "use_anchors": true, - "clear_index": false, - "conversation_id": ["706181789"], - "nb_hits": 17139 -} diff --git a/src/components/search-input/index.tsx b/src/components/search-input/index.tsx index 6770a980..d803b990 100644 --- a/src/components/search-input/index.tsx +++ b/src/components/search-input/index.tsx @@ -42,7 +42,7 @@ export default function SearchInput() { const resultsBox = useRef() useClickOutside(resultsBox, setfocusOut) return ( - + setfocusOut({ modaltoggle: true })} ref={resultsBox}> diff --git a/src/pages/updates/announcements/[slug].tsx b/src/pages/updates/announcements/[slug].tsx index 39b64cef..cecbde96 100644 --- a/src/pages/updates/announcements/[slug].tsx +++ b/src/pages/updates/announcements/[slug].tsx @@ -88,7 +88,7 @@ const NewsPage: NextPage = ({ serialized, branch }) => { <> {serialized.frontmatter?.title as string} - +