Skip to content

Commit

Permalink
add algolia searchbar (#4696)
Browse files Browse the repository at this point in the history
* add algolia searchbar

Signed-off-by: Niels Bantilan <[email protected]>

* update css and search.html filepath

Signed-off-by: Niels Bantilan <[email protected]>

---------

Signed-off-by: Niels Bantilan <[email protected]>
  • Loading branch information
cosmicBboy authored and katrogan committed Jan 12, 2024
1 parent 43ab8bc commit 342941c
Show file tree
Hide file tree
Showing 7 changed files with 179 additions and 1 deletion.
12 changes: 12 additions & 0 deletions docs/_static/algolia-search.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*global docsearch*/

docsearch({
container: ".docsearch",
appId: "WLG0MZB58Q",
apiKey: "28bf9bfd4a77a7d6b3ab7e98c671e781",
indexName: "flyte",
searchParameters: {
hitsPerPage: 10,
// See https://www.algolia.com/doc/api-reference/api-parameters/
},
});
23 changes: 23 additions & 0 deletions docs/_static/algolia.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/* Algolia Docs Search Style */
.docsearch {
width: 100% !important;
}

.DocSearch-Button {
height: 60px !important;
width: 100% !important;
margin: 0px !important;
border-radius: 0 !important;
border-bottom: 1px solid var(--color-header-border) !important;
background: var(--color-sidebar-background) !important;
padding: 0 15px !important;
}

.DocSearch-Button:hover, .DocSearch-Button:active {
box-shadow: none !important;
background: var(--docsearch-searchbox-background) !important;
}

.sidebar-search-container::before {
content: none;
}
11 changes: 11 additions & 0 deletions docs/_static/flyte.css
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ h6 {
width: 100% !important;
margin: 0px !important;
border-radius: 0 !important;
border-top: 1px solid var(--color-header-border) !important;
border-bottom: 1px solid var(--color-header-border) !important;
background: var(--color-sidebar-background) !important;
padding: 0 15px !important;
Expand All @@ -53,6 +54,16 @@ h6 {
background: var(--docsearch-searchbox-background) !important;
}

.DocSearch-Button-Key {
border-radius: 3px !important;
box-shadow: var(--docsearch-key-shadow) !important;
color: var(--docsearch-muted-color) !important;
display: flex !important;
margin-right: 0.4em !important;
padding: 0 0 2px !important;
border: 0 !important;
}

.sidebar-search-container::before {
content: none;
}
Expand Down
125 changes: 125 additions & 0 deletions docs/_templates/base.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions docs/_templates/page.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions docs/_templates/sidebar/search.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["_static"]
html_css_files = ["custom.css", "flyte.css"]
html_css_files = ["custom.css", "flyte.css", "algolia.css"]

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
Expand Down

0 comments on commit 342941c

Please sign in to comment.