Skip to content

Commit 56301c1

Browse files
committed

File tree

4 files changed

+106
-7
lines changed

4 files changed

+106
-7
lines changed

.github/workflows/spider-check.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: spider-check
2+
on:
3+
# Once a week on Friday at 00:00
4+
schedule:
5+
- cron: '0 0 * * 5'
6+
# Or manually
7+
workflow_dispatch:
8+
# Or when developing this workflow
9+
push:
10+
paths:
11+
- .github/workflows/spider-check.yaml
12+
pull_request:
13+
paths:
14+
- .github/workflows/spider-check.yaml
15+
16+
jobs:
17+
spider-check:
18+
env:
19+
MY_SITE: https://api.jquery.com
20+
runs-on: ubuntu-latest
21+
if: ${{ github.repository_owner == 'jquery' }} # skip on forks
22+
steps:
23+
- uses: actions/checkout@v2
24+
with:
25+
repository: jquery/hydra-link-checker
26+
ref: v2.0.0
27+
- name: Run hydra-link-checker
28+
run: python3 hydra.py "$MY_SITE"

.github/workflows/typesense.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: typesense
2+
on:
3+
# Once a day at 11:30 UTC <https://crontab.guru/>
4+
schedule:
5+
- cron: '30 11 * * *'
6+
# Or after a deployment
7+
push:
8+
branches:
9+
- main
10+
# Or manually
11+
workflow_dispatch:
12+
13+
jobs:
14+
typesense:
15+
name: Update Typesense
16+
if: ${{ github.repository_owner == 'jquery' }} # skip on forks
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v3
20+
- name: Docsearch Scraper
21+
shell: bash
22+
run: |
23+
# 0.6.0.rc1: https://github.com/typesense/typesense-docsearch-scraper/issues/36
24+
docker run \
25+
-e TYPESENSE_API_KEY=${{ secrets.TYPESENSE_ADMIN_KEY }} \
26+
-e TYPESENSE_HOST="${{ secrets.TYPESENSE_HOST }}" \
27+
-e TYPESENSE_PORT="443" \
28+
-e TYPESENSE_PROTOCOL="https" \
29+
-e CONFIG="$(cat docsearch.config.json | jq -r tostring)" \
30+
typesense/docsearch-scraper:0.6.0.rc2

.travis.yml

Lines changed: 0 additions & 7 deletions
This file was deleted.

docsearch.config.json

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"index_name": "jquery_com",
3+
"start_urls": [
4+
{ "url": "https://jquery.com" },
5+
{ "url": "https://api.jquery.com", "selectors_key": "api" }
6+
],
7+
"stop_urls": [
8+
".com/category/"
9+
],
10+
"selectors": {
11+
"default": {
12+
"lvl0": {
13+
"selector": "#menu-top .menu-item.current > a",
14+
"global": true,
15+
"default_value": "Documentation"
16+
},
17+
"lvl1": "#content h1",
18+
"lvl2": "#content h2",
19+
"lvl3": "#content h3",
20+
"lvl4": "#content h4",
21+
"lvl5": "#content h5",
22+
"text": "#content p, #content li, #content tr"
23+
},
24+
"api": {
25+
"lvl0": {
26+
"selector": "#categories .cat-item.current-cat > a",
27+
"global": true,
28+
"default_value": "API"
29+
},
30+
"lvl1": "#content h1",
31+
"lvl2": "#content h2, #content h4.name",
32+
"lvl3": "#content h3, #content h4:not(.name)",
33+
"lvl4": "#content h5, #content strong:first-child",
34+
"text": ".entry-content p, .entry-content li"
35+
}
36+
},
37+
"selectors_exclude": [
38+
"header ~ article",
39+
".returns",
40+
".version-details",
41+
".section-title",
42+
".icon-link.toc-link",
43+
"[class^=toclevel]",
44+
"#toctitle"
45+
],
46+
"min_indexed_level": 2,
47+
"scrape_start_urls": false
48+
}

0 commit comments

Comments
 (0)