-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from onflow/nialexsan/search
- Loading branch information
Showing
9 changed files
with
347 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
TYPESENSE_NODE="<TYPESENSE_NODE>" | ||
TYPESENSE_SEARCH_ONLY_API_KEY="<TYPESENSE_SEARCH_ONLY_API_KEY>" | ||
TYPESENSE_ADMIN_API_KEY="<TYPESENSE_ADMIN_API_KEY>" | ||
|
||
MIXPANEL_PROJECT_TOKEN="<MIXPANEL_PROJECT_TOKEN>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Test build & Scrape | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
|
||
env: | ||
TYPESENSE_NODE: ${{ vars.TYPESENSE_NODE }} | ||
TYPESENSE_ADMIN_API_KEY: ${{ secrets.TYPESENSE_ADMIN_API_KEY }} | ||
|
||
jobs: | ||
build: | ||
name: Test build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: npm | ||
|
||
- name: Install dependencies | ||
run: npm i | ||
|
||
- name: Build website | ||
run: npm run build | ||
|
||
- name: Run DocSearch Scraper | ||
uses: celsiusnarhwal/typesense-scraper@v2 | ||
with: | ||
# The secret containing your Typesense API key. Required. | ||
api-key: ${{ env.TYPESENSE_ADMIN_API_KEY }} | ||
|
||
# The hostname or IP address of your Typesense server. Required. | ||
host: ${{ env.TYPESENSE_NODE }} | ||
|
||
# The port on which your Typesense server is listening. Optional. Default: 8108. | ||
port: 443 | ||
|
||
# The protocol to use when connecting to your Typesense server. Optional. Default: http. | ||
protocol: https | ||
|
||
# The path to your DocSearch config file. Optional. Default: docsearch.config.json. | ||
config: docsearch.config.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: DocSearch Scraper | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
env: | ||
TYPESENSE_NODE: ${{ vars.TYPESENSE_NODE }} | ||
TYPESENSE_ADMIN_API_KEY: ${{secrets.TYPESENSE_ADMIN_API_KEY}} | ||
|
||
jobs: | ||
crawl: | ||
name: Crawl Pages | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Run DocSearch Scraper | ||
uses: celsiusnarhwal/typesense-scraper@v2 | ||
with: | ||
# The secret containing your Typesense API key. Required. | ||
api-key: ${{ env.TYPESENSE_ADMIN_API_KEY }} | ||
|
||
# The hostname or IP address of your Typesense server. Required. | ||
host: ${{ env.TYPESENSE_NODE }} | ||
|
||
# The port on which your Typesense server is listening. Optional. Default: 8108. | ||
port: 443 | ||
|
||
# The protocol to use when connecting to your Typesense server. Optional. Default: http. | ||
protocol: https | ||
|
||
# The path to your DocSearch config file. Optional. Default: docsearch.config.json. | ||
config: docsearch.config.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,4 +18,4 @@ | |
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{ | ||
"index_name": "cadence_lang", | ||
"start_urls": [ | ||
"https://cadence-lang.org/" | ||
], | ||
"sitemap_urls": [ | ||
"https://cadence-lang.org/sitemap.xml" | ||
], | ||
"sitemap_alternate_links": true, | ||
"stop_urls": [ | ||
"/tests" | ||
], | ||
"selectors": { | ||
"lvl0": { | ||
"selector": "(//ul[contains(@class,'menu__list')]//a[contains(@class, 'menu__link menu__link--sublist menu__link--active')]/text() | //nav[contains(@class, 'navbar')]//a[contains(@class, 'navbar__link--active')]/text())[last()]", | ||
"type": "xpath", | ||
"global": true, | ||
"default_value": "Documentation" | ||
}, | ||
"lvl1": "article h1, header h1", | ||
"lvl2": "article h2", | ||
"lvl3": "article h3", | ||
"lvl4": "article h4", | ||
"lvl5": "article h5, article td:first-child", | ||
"lvl6": "article h6", | ||
"text": "article p, article li, article td:last-child" | ||
}, | ||
"strip_chars": " .,;:#", | ||
"custom_settings": { | ||
"separatorsToIndex": "_", | ||
"attributesForFaceting": [ | ||
"language", | ||
"version", | ||
"type", | ||
"docusaurus_tag" | ||
], | ||
"attributesToRetrieve": [ | ||
"hierarchy", | ||
"content", | ||
"anchor", | ||
"url", | ||
"url_without_anchor", | ||
"type" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
6a2e179
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
cadence-lang-docs – ./
cadence-lang-docs.vercel.app
cadence-lang-docs-git-main-onflow.vercel.app
cadence-lang-docs-onflow.vercel.app