Skip to content

Commit

Permalink
feat: add crawler configuration (#688)
Browse files Browse the repository at this point in the history
Signed-off-by: Jack Yu <[email protected]>
  • Loading branch information
Yu-Jack authored Dec 10, 2024
1 parent 6ed6729 commit 0d7cb8f
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ jobs:
contents: write
pages: write
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Checkout code
uses: actions/checkout@v4

Expand Down Expand Up @@ -59,3 +62,10 @@ jobs:
AUTHOR_EMAIL: ${{ steps.vars.outputs.email }}
COMMIT: ${{ steps.vars.outputs.sha_short }}
GITHUB_REPO_LINK: "${{ github.server_url }}/${{ github.repository }}.git"
- name: Crawler
run: |
docker run \
-e APPLICATION_ID=${{ secrets.ALGOLIA_APP_ID }} \
-e API_KEY=${{ secrets.ALGOLIA_CRAWLER_API_KEY }} \
-e "CONFIG=$(cat ./docsearch.json | jq -r tostring)" \
algolia/docsearch-scraper
23 changes: 23 additions & 0 deletions docsearch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"index_name": "harvester",
"sitemap_urls": ["http://docs.harvesterhci.io/sitemap.xml"],
"start_urls": ["http://docs.harvesterhci.io/"],
"selectors": {
"lvl0": "",
"lvl1": "article h1",
"lvl2": "article h2",
"lvl3": "article h3",
"lvl4": "article h4",
"lvl5": "article h5",
"lvl6": "article h6",
"text": "article p, article li, article td:last-child"
},
"custom_settings": {
"attributesForFaceting": [
"language",
"version",
"type",
"docusaurus_tag"
]
}
}

0 comments on commit 0d7cb8f

Please sign in to comment.