Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
feat(website): enable docsearch (#409)
  • Loading branch information
ykzts committed Mar 13, 2021
1 parent d4034b4 commit 959d83a
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 0 deletions.
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

1 comment on commit 959d83a

@vercel
Copy link

@vercel vercel bot commented on 959d83a Mar 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.