From e97a43f2009545d0a7fa15c7e00666d6dce0a2e1 Mon Sep 17 00:00:00 2001 From: Billy Tat Date: Fri, 9 Sep 2022 16:48:13 -0700 Subject: [PATCH] [skip ci] Add Algolia crawler config and info --- algolia-search/README.md | 22 ++++++++++++++++++++++ algolia-search/config.json | 21 +++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 algolia-search/README.md create mode 100644 algolia-search/config.json diff --git a/algolia-search/README.md b/algolia-search/README.md new file mode 100644 index 00000000000..0a70707615c --- /dev/null +++ b/algolia-search/README.md @@ -0,0 +1,22 @@ +# Algolia with Rancher Manager Documentation + +The search index used by the Rancher Manager documentation is generated by [running our own crawler](https://docsearch.algolia.com/docs/legacy/run-your-own). + +## Running the Crawler + +To run the crawler, you'll need: +- A configuration file, which can be found [here](./config.json). +- An `.env` file, containing your credentials. + +``` +APPLICATION_ID= +API_KEY= +``` + +If you're running the crawler from the Docker image, run: + +``` +docker run -it --env-file=.env -e "CONFIG=$(cat ./config.json | jq -r tostring)" algolia/docsearch-scraper +``` + +Otherwise, follow [these instructions](https://docsearch.algolia.com/docs/legacy/run-your-own#running-the-crawler-from-the-code-base) if running the crawler using the code base. diff --git a/algolia-search/config.json b/algolia-search/config.json new file mode 100644 index 00000000000..855ad47514b --- /dev/null +++ b/algolia-search/config.json @@ -0,0 +1,21 @@ +{ + "index_name": "docs_ranchermanager_rancher_io", + "sitemap_urls": ["http://docs.ranchermanager.rancher.io/sitemap.xml"], + "start_urls": ["http://docs.ranchermanager.rancher.io/"], + "selectors": { + "lvl0": "", + "lvl1": "article h1", + "lvl2": "article h2", + "lvl3": "article h3", + "lvl4": "article h4", + "lvl5": "article h5" + }, + "custom_settings": { + "attributesForFaceting": [ + "language", + "version", + "type", + "docusaurus_tag" + ] + } + }