Skip to content

Commit 42c9b4a

Browse files
Merge pull request #13 from bitbomdev/naveen/addSearchBar
Included the Search Bar
2 parents b23442b + 486729b commit 42c9b4a

File tree

3 files changed

+46
-1
lines changed

3 files changed

+46
-1
lines changed

docsearch.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"index_name": "bitbom",
3+
"start_urls": ["https://bitbom.dev"],
4+
"sitemap_urls": ["https://bitbom.dev/sitemap.xml"],
5+
"selectors": {
6+
"lvl0": {
7+
"selector": ".navbar__link--active",
8+
"global": true,
9+
"default_value": "Documentation"
10+
},
11+
"lvl1": "article h1",
12+
"lvl2": "article h2",
13+
"lvl3": "article h3",
14+
"lvl4": "article h4",
15+
"lvl5": "article h5",
16+
"text": "article p, article li"
17+
}
18+
}

docusaurus.config.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,14 @@ const config: Config = {
128128
src: 'img/bitbomLogoBig.png',
129129
},
130130
items: [
131-
132131
{type: 'docSidebar', sidebarId: 'docs', label: 'Docs', position: 'left'},
133132
{to: '/demos/starting-up-minefield', label: 'Demos', position: 'left'},
134133
{to: '/blog', label: 'Blog', position: 'left'},
135134
{to: '/glossary', label: 'Glossary', position: 'left'},
135+
{
136+
type: 'search',
137+
position: 'left',
138+
},
136139
{
137140
type: 'custom-wrapper',
138141
position: 'right',
@@ -206,6 +209,12 @@ const config: Config = {
206209
// phpLoader: 'matomo.php',
207210
// jsLoader: 'matomo.js',
208211
// },
212+
algolia: {
213+
appId: 'XVADXTT1S0',
214+
apiKey: 'dd44c26b3affe3e878fa9469701eb849', // search only API key
215+
indexName: 'bitbom',
216+
contextualSearch: true,
217+
},
209218
} satisfies Preset.ThemeConfig,
210219
};
211220

src/css/custom.css

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@
5454
--theme-lightest-cyan: #ADE8F4;
5555
--theme-palest-cyan: #CAF0F8;
5656
--theme-white: #FFFFFF;
57+
58+
--search-bar-background: #EDF2F5;
5759
}
5860

5961

@@ -240,3 +242,19 @@ canary-trigger-searchbar::part(kbd) {
240242
background-position: 0% 50%;
241243
}
242244
}
245+
246+
/* Customize DocSearch colors */
247+
.DocSearch {
248+
--docsearch-text-color: var(--glasskube-grey-0);
249+
--docsearch-muted-color: var(--glasskube-grey-0);
250+
--docsearch-container-background: rgba(12, 38, 59, 0.7);
251+
}
252+
253+
/* Dark mode colors */
254+
[data-theme='dark'] .DocSearch {
255+
--docsearch-text-color: var(--glasskube-main-light);
256+
--docsearch-muted-color: var(--glasskube-main-light);
257+
--docsearch-container-background: rgba(12, 38, 59, 0.8);
258+
--docsearch-modal-background: var(--glasskube-background-dark);
259+
--docsearch-searchbox-background: var(--glasskube-background-dark);
260+
}

0 commit comments

Comments
 (0)