id | title | hide_title | sidebar_position | tags | last_update | unlisted | |||||
---|---|---|---|---|---|---|---|---|---|---|---|
renew-algolia-docsearch-index |
Renew Algolia DocSearch Index |
true |
10 |
|
|
true |
-
Make sure right
API_KEY
is set in{site_root_dir}/.env
file.APPLICATION_ID={ALGOLIA_APPLICATION_ID} API_KEY={ALGOLIA_API_KEY}
If your don't have
{ALGOLIA_APPLICATION_ID}
and{ALGOLIA_API_KEY}
, CheckAPPLICATION_ID
andAPI_KEY
in Algolia dashboard. -
Build the website.
$ npm run build
-
Check render effect through
./build
.$ npm run serve -- --host 0.0.0.0 --port 3006 --no-open
Noted that you can't launch the website with
npm start
this time, because we need to serve the website locally from./build
that we just built. -
Proxy your website with ngrok in temporary domain URL.
The terminal you have your ngrok installed, mine in my local machine:
$ ngrok http 3006 --region jp
-
Modify your algolia config in
./algolia/dev-algolia-config.json
file.{ "start_urls": ["https://{NGROK_TEMPORARY_DOMAIN_URL}"], "sitemap_urls": [ "https://{NGROK_TEMPORARY_DOMAIN_URL}/sitemap.xml" ], ... }
-
Run the scraper in WSL2 terminal.
docker run -it --env-file=.env -e "CONFIG=$(cat ./algolia/dev-algolia-config.json | jq -r tostring)" algolia/docsearch-scraper
-
Go checkout the Algolia dashboard with specified
index_name
(e.g. dev_personal_website). -
Back to docker terminal and run
npm start
again, to check the render effect.