Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(website): enable docsearch #409

Merged
merged 1 commit into from Mar 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/scrape.yml
@@ -0,0 +1,24 @@
name: DocSearch Scraper

on:
schedule:
- cron: '53 1 * * *'

jobs:
scrape:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Get DocSearch configuration
id: docsearch-config
run: echo "::set-output name=json::$(cat docsearch.json | jq -r tostring)"
- name: Pull DocSearch Scraper
run: docker pull algolia/docsearch-scraper:latest
- name: Run DocSearch Scraper
run: docker run -e TZ -e API_KEY -e APPLICATION_ID -e CONFIG algolia/docsearch-scraper:latest
env:
TZ: UTC
API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
APPLICATION_ID: ${{ secrets.ALGOLIA_APPLICATION_ID }}
CONFIG: ${{ steps.docsearch-config.outputs.json }}
35 changes: 35 additions & 0 deletions docsearch.json
@@ -0,0 +1,35 @@
{
"custom_settings": {
"separatorsToIndex": "_",
"attributesForFaceting": ["language", "version", "type", "docusaurus_tag"],
"attributesToRetrieve": [
"hierarchy",
"content",
"anchor",
"url",
"url_without_anchor",
"type"
]
},
"index_name": "docusaurus",
"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": "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"
},
"sitemap_alternate_links": true,
"sitemap_urls": ["https://manael.org/sitemap.xml"],
"start_urls": ["https://manael.org/"],
"strip_chars": " .,;:#",
"stop_urls": []
}
5 changes: 5 additions & 0 deletions website/docusaurus.config.js
Expand Up @@ -35,6 +35,11 @@ module.exports = {
projectName: 'manael',
tagline: 'Manael is a simple HTTP proxy for processing images.',
themeConfig: {
algolia: {
appId: 'ZX7VYOHRJ3',
apiKey: '43f66f766ffb77ee2280608d793ab235',
indexName: 'docusaurus'
},
footer: {
copyright: 'Copyright © 2018 The Manael Authors.',
links: [],
Expand Down