Skip to content

Commit e1f6304

Browse files
committed
feat(algolia): Add Algolia search, update docusaurus and styling
1 parent ee6df2b commit e1f6304

File tree

7 files changed

+563
-532
lines changed

7 files changed

+563
-532
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Run Algolia Scraper
2+
3+
on:
4+
push:
5+
branches: ["master"]
6+
pull_request:
7+
branches: ["master"]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
- uses: darrenjennings/algolia-docsearch-action@master
18+
with:
19+
algolia_application_id: "1BEGBIP9SH"
20+
algolia_api_key: "9d8e6ed4db04716282b15a926825fdcc"
21+
file: "docs/algolia.config.json"

docs/algolia.config.json

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"index_name": "docusaurus-2",
3+
"start_urls": [
4+
"https://rest-apis-flask.teclado.com/"
5+
],
6+
"sitemap_urls": [
7+
"https://rest-apis-flask.teclado.com/sitemap.xml"
8+
],
9+
"sitemap_alternate_links": true,
10+
"stop_urls": [
11+
"/tests"
12+
],
13+
"selectors": {
14+
"lvl0": {
15+
"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()]",
16+
"type": "xpath",
17+
"global": true,
18+
"default_value": "Documentation"
19+
},
20+
"lvl1": "header h1",
21+
"lvl2": "article h2",
22+
"lvl3": "article h3",
23+
"lvl4": "article h4",
24+
"lvl5": "article h5, article td:first-child",
25+
"lvl6": "article h6",
26+
"text": "article p, article li, article td:last-child"
27+
},
28+
"strip_chars": " .,;:#",
29+
"custom_settings": {
30+
"separatorsToIndex": "_",
31+
"attributesForFaceting": [
32+
"language",
33+
"version",
34+
"type",
35+
"docusaurus_tag"
36+
],
37+
"attributesToRetrieve": [
38+
"hierarchy",
39+
"content",
40+
"anchor",
41+
"url",
42+
"url_without_anchor",
43+
"type"
44+
]
45+
},
46+
"conversation_id": [
47+
"833762294"
48+
],
49+
"nb_hits": 46250
50+
}

docs/docusaurus.config.js

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ const config = {
2929
({
3030
docs: {
3131
sidebarPath: require.resolve("./sidebars.js"),
32+
sidebarCollapsible: false,
3233
exclude: ["**/start/**", "**/end/**"],
3334
// Please change this to your repo.
3435
editUrl:
@@ -40,10 +41,35 @@ const config = {
4041
}),
4142
],
4243
],
43-
plugins: [require.resolve("@cmfcmf/docusaurus-search-local")],
4444
themeConfig:
4545
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
4646
({
47+
docs: {
48+
sidebar: {
49+
hideable: true,
50+
},
51+
},
52+
algolia: {
53+
// The application ID provided by Algolia
54+
appId: "1BEGBIP9SH",
55+
56+
// Public API key: it is safe to commit it
57+
apiKey: "882167549d623413f9b5314788a0d900",
58+
59+
indexName: "restApisFlask_ebook_teclado",
60+
61+
// Optional: see doc section below
62+
// contextualSearch: true,
63+
64+
// Optional: Specify domains where the navigation should occur through window.location instead on history.push. Useful when our Algolia config crawls multiple documentation sites and we want to navigate with window.location.href to them.
65+
// externalUrlRegex: "external\\.com|domain\\.com",
66+
67+
// Optional: Algolia search parameters
68+
searchParameters: {},
69+
70+
// Optional: path for search page that enabled by default (`false` to disable it)
71+
searchPagePath: "search",
72+
},
4773
navbar: {
4874
title: "REST APIs with Flask and Python",
4975
logo: {

0 commit comments

Comments
 (0)