Skip to content

Commit

Permalink
Add Algolia DocSearch
Browse files Browse the repository at this point in the history
  • Loading branch information
255kb committed Nov 17, 2023
1 parent 87565cc commit 6cbee22
Show file tree
Hide file tree
Showing 7 changed files with 457 additions and 15 deletions.
14 changes: 11 additions & 3 deletions components/nav.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { DocSearch } from '@docsearch/react';
import Link from 'next/link';
import { useRouter } from 'next/router';
import { FunctionComponent, useState } from 'react';
Expand Down Expand Up @@ -49,6 +50,7 @@ const Nav: FunctionComponent = function () {
</a>

{toggler}

<div
className={
show ? 'collapse navbar-collapse show' : 'collapse navbar-collapse'
Expand All @@ -68,6 +70,14 @@ const Nav: FunctionComponent = function () {
</Link>
</li>
)}

<li className='nav-item'>
<DocSearch
appId='HV1IDAB8IU'
indexName='mockoon'
apiKey='c3396e739c9949cf6ccf7305b8da46aa'
/>
</li>
<li
className='nav-item dropdown text-center'
onMouseEnter={() => {
Expand Down Expand Up @@ -161,9 +171,7 @@ const Nav: FunctionComponent = function () {
<Link
href='/course/'
className={`nav-link ${
router.pathname === '/course'
? 'active'
: ''
router.pathname === '/course' ? 'active' : ''
}`}
>
Course
Expand Down
Loading

0 comments on commit 6cbee22

Please sign in to comment.