Skip to content

Latest commit

 

History

History
87 lines (67 loc) · 1.99 KB

DEVLOG.md

File metadata and controls

87 lines (67 loc) · 1.99 KB

Development Guide

Development Setup

Development Log

  1. Configure your key, in .env
   # Sign up for an account & Create Aplication
   ALGOLIA_APP_INDEX='YOUR_INDEX_NAME'
   ALGOLIA_APP_ID='Application ID'
   ALGOLIA_API_KEY='Admin API Key'
  1. please reference file: docusaurus.config.ts

    themeConfig: {
        // ......
    	algolia: {
          appId: process.env.ALGOLIA_APP_ID,
          apiKey: process.env.ALGOLIA_API_KEY,
          indexName: process.env.ALGOLIA_APP_INDEX,
        }
    }
  2. add file: docsearch.json,For more configurations, please refer to the Config templates

    {
      // ......
      "index_name": "YOUR_INDEX_NAME",
      "start_urls": ["YOUR_WEB"],
      "sitemap_urls": ["YOUR_WEB"],
      "stop_urls": ["/search"]
    }
  3. To update the site search data, you can choose one of the three methods

    • Local operation

      yum install -y epel-release
      yum install -y jq
      docker run -it --env-file=.env -e "CONFIG=$(cat docsearch.json | jq -r tostring)" algolia/docsearch-scraper
    • GitHub Actions

      name: docsearch-scraper
      
      on:
        push:
          branches: [main]
      
      jobs:
        scan:
          runs-on: ubuntu-latest
      
          steps:
            - name: Checkout repo
              uses: actions/checkout@v3
      
            - name: Run scraper
              env:
                APPLICATION_ID: ${{ secrets.APPLICATION_ID }}
                API_KEY: ${{ secrets.API_KEY }}
              run: |
                CONFIG="$(cat docsearch.json)"
                docker run -i --rm \
                        -e APPLICATION_ID=$APPLICATION_ID \
                        -e API_KEY=$API_KEY \
                        -e CONFIG="${CONFIG}" \
                        algolia/docsearch-scraper
    • Waiting for official review

      https://docsearch.algolia.com/apply