Skip to content

Commit

Permalink
Enable search
Browse files Browse the repository at this point in the history
  • Loading branch information
zhe-slac committed Nov 7, 2023
1 parent e68348b commit 629f258
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

# Misc
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
Expand Down
46 changes: 46 additions & 0 deletions algolia.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"index_name": "badger",
"start_urls": [
"https://slac-ml.github.io/Badger/"
],
"sitemap_urls": [
"https://slac-ml.github.io/Badger/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"
]
}
}
13 changes: 13 additions & 0 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,19 @@ const config = {
darkTheme: darkCodeTheme,
additionalLanguages: ['python'],
},
algolia: {
// The application ID provided by Algolia
appId: 'WPJQG5P0EZ',
// Public API key: it is safe to commit it
apiKey: 'b63157c581646ac999c9ce4c3569e3e3',
indexName: 'badger',
// Optional: see doc section below
contextualSearch: true,
// Optional: Algolia search parameters
searchParameters: {},
// Optional: path for search page that enabled by default (`false` to disable it)
searchPagePath: 'search',
},
}),
}

Expand Down

0 comments on commit 629f258

Please sign in to comment.