Skip to content

Commit

Permalink
Adding local search with @cmfcmf-plugin (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
FilipHarald authored Sep 13, 2024
1 parent 1703d5d commit f29fa81
Show file tree
Hide file tree
Showing 4 changed files with 152 additions and 5 deletions.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@ npm install
npm run start
```

### Run docs with search feature enabled

Instead of `npm run start`, you'll need to:

```bash
npm run docusaurus build
npm run docusaurus serve
```

If you change the [search configuration](/docusaurus.config.js#L27), you'll need to run `npm run docusaurus build` and then `npm run docusaurus serve` again to refresh with the changes.

## Contribution Guidelines

Thank you for your interest in contributing to improve the documentation!
Expand All @@ -40,7 +51,7 @@ If you find anything that is confusing or can be improved in an existing documen

When **adding a new page**, you need to fork the repository, create a new branch, and make all changes necessary in your repository. Once you are done with your changes, create a PR to Scaffold-ETH 2 Documentation repository.

Add the new pages to the `docs` folder, placing them in the specific directory where you want the page to be shown.
Add the new pages to the `docs` folder, placing them in the specific directory where you want the page to be shown.
**Siderbar** link will get **autogenerated** under your specific folder, in the **position** that you specify in your document header. Example:

```markdown
Expand Down
10 changes: 9 additions & 1 deletion docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,15 @@ const config = {
// If you aren't using GitHub pages, you don't need these.
organizationName: "scaffold-eth",
projectName: "scaffold-eth-2",

plugins: [
[
require.resolve("@cmfcmf/docusaurus-search-local"),
{
indexBlog: false,
includeParentCategoriesInPageTitle: true,
},
],
],
scripts: [
{
src: "https://plausible.io/js/plausible.js",
Expand Down
133 changes: 130 additions & 3 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 @@ -16,6 +16,7 @@
"format-check": "npx prettier --check '**/*.{js,jsx,md,mdx,json,css}'"
},
"dependencies": {
"@cmfcmf/docusaurus-search-local": "^1.2.0",
"@docusaurus/core": "2.4.0",
"@docusaurus/preset-classic": "2.4.0",
"@mdx-js/react": "^1.6.22",
Expand Down

0 comments on commit f29fa81

Please sign in to comment.