Skip to content

Commit

Permalink
add search
Browse files Browse the repository at this point in the history
  • Loading branch information
EwanLyon committed Nov 13, 2023
1 parent 4f15305 commit eeefb81
Show file tree
Hide file tree
Showing 11 changed files with 572 additions and 169 deletions.
2 changes: 1 addition & 1 deletion docs/guides/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ The file can be found in the root directory of the project.

[Docusaurus Guide](https://docusaurus.io/docs/create-doc)

To create pages just make a new markdown file (`.md`) in the `docs/` folder.
To create pages make a new text file with the file extension `.md` in the `docs/` folder.

To create nested pages create a folder and add the file there.

Expand Down
4 changes: 2 additions & 2 deletions docs/guides/markdown-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Here's a quick [Markdown Cheat Sheet](https://www.markdownguide.org/cheat-sheet/

\[Another link to a doc page](./folder/another-doc.md)

\[A link to a url](https://google.com/)
\[A link to a website](https://google.com/)

### Text style

Expand All @@ -36,7 +36,7 @@ Here's a quick [Markdown Cheat Sheet](https://www.markdownguide.org/cheat-sheet/

## Admonitions

More details at the [Docusaurus Documentation](https://docusaurus.io/docs/markdown-features/admonitions).
More details in the [Docusaurus Documentation](https://docusaurus.io/docs/markdown-features/admonitions).

```markdown
:::note
Expand Down
77 changes: 43 additions & 34 deletions docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import speeddocsConfig from './speedrun-docs.json';
import type { Config } from '@docusaurus/types';
import type { Options, ThemeConfig } from '@docusaurus/preset-classic';

import localSearch from "@easyops-cn/docusaurus-search-local";

import { themes as prismThemes } from 'prism-react-renderer';

const optionalNavbarItems: Record<string, any>[] = [];
Expand Down Expand Up @@ -57,41 +59,48 @@ const config: Config = {
} satisfies Options,
],
],
themeConfig:
{
navbar: {
title: `${speeddocsConfig.game} Speedrun Docs`,
logo: {
alt: 'Speedrun Docs Logo',
src: 'img/run-man.svg',
},
items: [
{
type: 'docSidebar',
sidebarId: 'tutorialSidebar',
position: 'left',
label: 'Tutorial',
},
{
type: 'docSidebar',
sidebarId: 'resourcesSidebar',
position: 'left',
label: 'Resources',
},
...optionalNavbarItems,
{
href: `https://github.com/${speeddocsConfig.github.username}/${speeddocsConfig.github.projectName}`,
position: 'right',
className: 'header-github-link',
'aria-label': 'GitHub repository',
},
],
themeConfig: {
navbar: {
title: `${speeddocsConfig.game} Speedrun Docs`,
logo: {
alt: 'Speedrun Docs Logo',
src: 'img/run-man.svg',
},
prism: {
theme: prismThemes.github,
darkTheme: prismThemes.dracula,
},
} satisfies ThemeConfig,
items: [
{
type: 'docSidebar',
sidebarId: 'tutorialSidebar',
position: 'left',
label: 'Tutorial',
},
{
type: 'docSidebar',
sidebarId: 'resourcesSidebar',
position: 'left',
label: 'Resources',
},
...optionalNavbarItems,
{
href: `https://github.com/${speeddocsConfig.github.username}/${speeddocsConfig.github.projectName}`,
position: 'right',
className: 'header-github-link',
'aria-label': 'GitHub repository',
},
],
},
prism: {
theme: prismThemes.github,
darkTheme: prismThemes.dracula,
},
} satisfies ThemeConfig,
themes: [
[
localSearch,
({
hashed: true,
}) satisfies localSearch.PluginOptions
],
]
};

export default config;
Loading

0 comments on commit eeefb81

Please sign in to comment.