{"id":16712920,"url":"https://github.com/gabrielcsapo/docusaurus-plugin-search-local","last_synced_at":"2025-07-06T19:33:40.430Z","repository":{"id":39788334,"uuid":"404118736","full_name":"gabrielcsapo/docusaurus-plugin-search-local","owner":"gabrielcsapo","description":"An offline/local search plugin for Docusaurus v2","archived":false,"fork":false,"pushed_at":"2024-11-28T15:12:06.000Z","size":8798,"stargazers_count":26,"open_issues_count":14,"forks_count":8,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-08T23:48:20.573Z","etag":null,"topics":["docusaurus","local","search"],"latest_commit_sha":null,"homepage":"https://gabrielcsapo.github.io/docusaurus-plugin-search-local/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gabrielcsapo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-07T20:48:53.000Z","updated_at":"2025-03-06T15:21:44.000Z","dependencies_parsed_at":"2024-06-21T14:05:38.988Z","dependency_job_id":"21ba9dd0-e967-46e1-aab7-5ba9757feda0","html_url":"https://github.com/gabrielcsapo/docusaurus-plugin-search-local","commit_stats":{"total_commits":135,"total_committers":4,"mean_commits":33.75,"dds":0.5481481481481482,"last_synced_commit":"07bac3fd912679276fc8655ecf1ca8e7172aac55"},"previous_names":["gabrielcsapo/docusaurus-search-local"],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrielcsapo%2Fdocusaurus-plugin-search-local","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrielcsapo%2Fdocusaurus-plugin-search-local/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrielcsapo%2Fdocusaurus-plugin-search-local/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrielcsapo%2Fdocusaurus-plugin-search-local/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gabrielcsapo","download_url":"https://codeload.github.com/gabrielcsapo/docusaurus-plugin-search-local/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247947820,"owners_count":21023058,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docusaurus","local","search"],"created_at":"2024-10-12T20:44:40.016Z","updated_at":"2025-04-09T13:11:11.952Z","avatar_url":"https://github.com/gabrielcsapo.png","language":"TypeScript","readme":"# docusaurus-plugin-search-local\n\n[![Npm Version](https://img.shields.io/npm/v/docusaurus-plugin-search-local)](https://www.npmjs.com/package/docusaurus-plugin-search-local)\n[![CI Status](https://github.com/easyops-cn/docusaurus-search-local/workflows/CI/badge.svg?event=push)](https://github.com/easyops-cn/docusaurus-search-local/actions?query=workflow%3ACI)\n[![Coverage Status](https://coveralls.io/repos/github/easyops-cn/docusaurus-search-local/badge.svg?branch=master)](https://coveralls.io/github/easyops-cn/docusaurus-search-local?branch=master)\n\nAn offline/local search plugin for [Docusaurus v2](https://v2.docusaurus.io/), which supports multiple languages.\n\n\u003e Originally forked from [cmfcmf/docusaurus-search-local](https://github.com/cmfcmf/docusaurus-search-local).\n\u003e\n\u003e Then later fully rewritten with TypeScript 💪, styles polished 💅, and tests covered ✅.\n\n- [Live Demo](#live-demo)\n- [Screen Shots](#screen-shots)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Plugin Options](#plugin-options)\n- [Custom Styles](#custom-styles)\n- [Trouble Shooting](#trouble-shooting)\n- [Further Reading](#further-reading)\n- [Contributing](#contributing)\n\n## Live Demo\n\n[https://gabrielcsapo.github.io/docusaurus-plugin-search-local/](https://gabrielcsapo.github.io/docusaurus-plugin-search-local/)\n\n## Installation\n\n```shell\nnpm install --save docusaurus-plugin-search-local\n# or\nyarn add docusaurus-plugin-search-local\n```\n\n## Usage\n\nAdd `docusaurus-plugin-search-local` into your docusaurus plugins.\n\n````js\n// In your `docusaurus.config.js`:\nmodule.exports = {\n  // ... Your other configurations.\n  plugins: [\n    // ... Your other plugins.\n    [\n      require.resolve('docusaurus-plugin-search-local'),\n      {\n        // ... Your options.\n        // `hashed` is recommended as long-term-cache of index file is possible.\n        hashed: true,\n        // ```\n        // language: [\"en\", \"de\"],\n        // ```\n      },\n    ],\n  ],\n};\n````\n\n## Plugin Options\n\n| Name                             | Type                                     | Default      | Description                                                                                                                                  |\n| -------------------------------- | ---------------------------------------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------- |\n| indexDocs                        | boolean                                  | `true`       | Whether to index docs.                                                                                                                       |\n| indexBlog                        | boolean                                  | `true`       | Whether to index blog.                                                                                                                       |\n| indexPages                       | boolean                                  | `false`      | Whether to index pages.                                                                                                                      |\n| docsRouteBasePath                | string \\| string[]                       | `\"/docs\"`    | Base route path(s) of docs. Slash at beginning is not required.                                                                              |\n| blogRouteBasePath                | string \\| string[]                       | `\"/blog\"`    | Base route path(s) of blog. Slash at beginning is not required.                                                                              |\n| language                         | string \\| string[]                       | `\"en\"`       | All [lunr-languages](https://github.com/MihaiValentin/lunr-languages) supported languages.                                                   |\n| hashed                           | boolean                                  | `false`      | Whether to add a hashed query when fetching index (based on the content hash of all indexed `*.md` in `docsDir` and `blogDir` if applicable) |\n| docsDir                          | string \\| string[]                       | `\"docs\"`     | The dir(s) of docs to get the content hash, it's relative to the dir of your project.                                                        |\n| blogDir                          | string \\| string[]                       | `\"blog\"`     | Just like the `docsDir` but applied to blog.                                                                                                 |\n| removeDefaultStopWordFilter      | boolean                                  | `false`      | Sometimes people (E.g., us) want to keep the English stop words as indexed, since they maybe are relevant in programming docs.               |\n| highlightSearchTermsOnTargetPage | boolean                                  | `false`      | Highlight search terms on target page.                                                                                                       |\n| searchResultLimits               | number                                   | `8`          | Limit the search results.                                                                                                                    |\n| searchResultContextMaxLength     | number                                   | `50`         | Set the max length of characters of each search result to show.                                                                              |\n| translations                     | TranslationMap                           | -            | Set translations of this plugin, see [docs below](#translations).                                                                            |\n| ignoreFiles                      | string \\| RegExp \\| (string \\| RegExp)[] | /**meta**\\$/ | Set the match rules to ignore some files.                                                                                                    |\n\n### Translations\n\nTo make this plugin localized, pass a `translations` option which defaults to:\n\n```json\n{\n  \"search_placeholder\": \"Search\",\n  \"see_all_results\": \"See all results\",\n  \"no_results\": \"No results.\",\n  \"search_results_for\": \"Search results for \\\"{{ keyword }}\\\"\",\n  \"search_the_documentation\": \"Search the documentation\",\n  \"count_documents_found\": \"{{ count }} document found\",\n  \"count_documents_found_plural\": \"{{ count }} documents found\",\n  \"no_documents_were_found\": \"No documents were found\"\n}\n```\n\nNote that `*_plural` can be omitted if it is the same as singular.\n\n## Custom Styles\n\nThis plugin is shipped with polished styles just like the Algolia Search on the Docusaurus v2 website. Feel free to override these css custom properties (css variables) below.\n\n| Var                              | Default (light)                                                        | Default (dark)                                          |\n| -------------------------------- | ---------------------------------------------------------------------- | ------------------------------------------------------- |\n| --search-local-modal-background  | `#f5f6f7`                                                              | `var(--ifm-background-color)`                           |\n| --search-local-modal-shadow      | `inset 1px 1px 0 0 hsla(0, 0%, 100%, 0.5),`\u003cbr /\u003e`0 3px 8px 0 #555a64` | `inset 1px 1px 0 0 #2c2e40,`\u003cbr /\u003e`0 3px 8px 0 #000309` |\n| --search-local-modal-width       | `560px`                                                                | -                                                       |\n| --search-local-modal-width-sm    | `340px`                                                                | -                                                       |\n| --search-local-spacing           | `12px`                                                                 | -                                                       |\n| --search-local-hit-background    | `#fff`                                                                 | `var(--ifm-color-emphasis-100)`                         |\n| --search-local-hit-shadow        | `0 1px 3px 0 #d4d9e1`                                                  | `none`                                                  |\n| --search-local-hit-color         | `#444950`                                                              | `var(--ifm-font-color-base)`                            |\n| --search-local-hit-height        | `56px`                                                                 | -                                                       |\n| --search-local-highlight-color   | `var(--ifm-color-primary)`                                             | -                                                       |\n| --search-local-muted-color       | `#969faf`                                                              | `var(--ifm-color-secondary-darkest)`                    |\n| --search-local-icon-stroke-width | `1.4`                                                                  | -                                                       |\n| --search-local-hit-active-color  | `var(--ifm-color-white)`                                               | -                                                       |\n\nE.g.:\n\n```css\n:root {\n  --search-local-modal-width: 480px;\n  --search-local-highlight-color: #5468ff;\n}\n\nhtml[data-theme='dark'] {\n  --search-local-highlight-color: #d23669;\n}\n```\n\n## Troubleshooting\n\nWhen building your docs project, Set the env `DEBUG=docusaurus-plugin-search-local:*` to enable [debug](https://github.com/visionmedia/debug) logs.\n\n```shell\n# In your docs project:\nDEBUG=docusaurus-plugin-search-local:* yarn build\n```\n\n## Contributing\n\nSee [contributing guide](CONTRIBUTING.md).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgabrielcsapo%2Fdocusaurus-plugin-search-local","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgabrielcsapo%2Fdocusaurus-plugin-search-local","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgabrielcsapo%2Fdocusaurus-plugin-search-local/lists"}