Skip to content

Commit

Permalink
chore(cn): 添加 algolia workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ShenQingchuan committed Mar 6, 2023
1 parent 8e9ddb7 commit cd8e0b9
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 1 deletion.
19 changes: 19 additions & 0 deletions .github/workflows/algolia.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: algolia
on:
push:
branches:
- master
jobs:
algolia:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get the content of algolia.json as config
id: algolia_config
run: echo "config=$(cat crawlerConfig.json | jq -r tostring)" >> $GITHUB_OUTPUT
- name: Push indices to Algolia
uses: signcl/docsearch-scraper-action@master
env:
APPLICATION_ID: ${{ secrets.ALGOLIA_APP_ID }}
API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
CONFIG: ${{ steps.algolia_config.outputs.config }}
28 changes: 28 additions & 0 deletions crawlerConfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"index_name": "rollup_docs_CN",
"start_urls": ["https://rollup-docs-cn.netlify.app/"],
"rateLimit": 8,
"maxDepth": 10,
"selectors": {
"lvl0": {
"selector": "",
"defaultValue": "Documentation"
},
"lvl1": ".content h1",
"lvl2": ".content h2",
"lvl3": ".content h3",
"lvl4": ".content h4",
"lvl5": ".content h5",
"content": ".content p, .content li",
"lang": {
"selector": "/html/@lang",
"type": "xpath",
"global": true
}
},
"selectors_exclude": ["aside", ".page-footer", ".next-and-prev-link", ".table-of-contents"],
"custom_settings": {
"attributesForFaceting": ["lang", "tags"]
},
"js_render": true
}
2 changes: 1 addition & 1 deletion docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default withMermaid(
},
themeConfig: {
algolia: {
apiKey: '3e413d036f6be638bb6107567aa0db55',
apiKey: '1ad354aec09a57f18f8d9bec8a913e52',
appId: 'EMNHQTRZYG',
indexName: 'rollup_docs_CN'
},
Expand Down

0 comments on commit cd8e0b9

Please sign in to comment.