Skip to content

Commit

Permalink
Add back DocSearch
Browse files Browse the repository at this point in the history
  • Loading branch information
shartte committed Oct 30, 2023
1 parent 0c3af94 commit c1588ae
Show file tree
Hide file tree
Showing 4 changed files with 243 additions and 5 deletions.
228 changes: 224 additions & 4 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"lint": "next lint"
},
"dependencies": {
"@docsearch/react": "^3.5.2",
"@tippyjs/react": "^4.2.6",
"flatbuffers": "^23.5.26",
"next": "14.0.0",
Expand Down
8 changes: 8 additions & 0 deletions src/app/index.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
@import "@docsearch/css";

.DocSearch {
width: 100%;
margin: 0 0 1em;
border-radius: 0;
}

/* Pixeloid Mono font */
@font-face {
font-family: 'Pixeloid Mono';
Expand Down
11 changes: 10 additions & 1 deletion src/components/nav/GuideShell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import Image from "next/image";
import logo from "@assets/logo_00.png";
import GuideNavBar, { NavBarNode } from "@component/nav/GuideNavBar.tsx";
import { GuidePageTitleProvider } from "@component/nav/GuidePageTitleProvider.tsx";
import { DocSearch } from "@docsearch/react";

export interface GuideShellProps {
gameVersion: String;
Expand Down Expand Up @@ -49,8 +50,16 @@ function GuideShell({
<span aria-hidden="true"></span>
</a>
</div>
<div className={css.pageTitle}>{pageTitle && <h1>{pageTitle}</h1>}</div>
<div className={css.pageTitle}>{pageTitle}</div>
<aside onClick={() => setMenuExpanded(false)}>
<DocSearch
appId="EG2004GHB4"
indexName="appliedenergistics"
apiKey="ab39bd0dd374963dfa89e457fb10e514"
searchParameters={{
facetFilters: ["version:" + gameVersion],
}}
/>
<GuideNavBar rootNodes={navigationNodes} />
</aside>
<article>
Expand Down

0 comments on commit c1588ae

Please sign in to comment.