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

Add Algolia search, update site style and update docusaurus #96

Merged
merged 5 commits into from
Nov 21, 2022
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/algolia-scraper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Run Algolia Scraper

on:
push:
branches: ["master", "develop"]
pull_request:
branches: ["master", "develop"]

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: darrenjennings/algolia-docsearch-action@master
with:
algolia_application_id: "1BEGBIP9SH"
algolia_api_key: ${{ secrets.ALGOLIA_API_KEY }}
file: "docs/algolia.config.json"
49 changes: 49 additions & 0 deletions docs/algolia.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"index_name": "docusaurus-2",
"start_urls": [
"https://rest-apis-flask.teclado.com/"
],
"sitemap_urls": [
"https://rest-apis-flask.teclado.com/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": "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"
]
},
"conversation_id": [
"833762294"
]
}
30 changes: 28 additions & 2 deletions docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ const config = {
projectName: "rest-apis-flask-python", // Usually your repo name.
scripts: [
{
src: "https://plausible.io/js/plausible.js",
src: "https://plau-prox.teclado.workers.dev/get/script.outbound-links.js",
defer: true,
"data-domain": "rest-apis-flask.teclado.com",
"data-api": "https://plau-prox.teclado.workers.dev/send/event",
},
],
presets: [
Expand All @@ -40,10 +41,35 @@ const config = {
}),
],
],
plugins: [require.resolve("@cmfcmf/docusaurus-search-local")],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
docs: {
sidebar: {
hideable: true,
},
},
algolia: {
// The application ID provided by Algolia
appId: "1BEGBIP9SH",

// Public API key: it is safe to commit it
apiKey: "882167549d623413f9b5314788a0d900",

indexName: "docusaurus-2",

// Optional: see doc section below
// contextualSearch: true,

// 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.
// externalUrlRegex: "external\\.com|domain\\.com",

// Optional: Algolia search parameters
searchParameters: {},

// Optional: path for search page that enabled by default (`false` to disable it)
searchPagePath: "search",
},
navbar: {
title: "REST APIs with Flask and Python",
logo: {
Expand Down
Loading