{"id":13553852,"url":"https://github.com/cmfcmf/docusaurus-search-local","last_synced_at":"2025-05-14T10:11:31.965Z","repository":{"id":37981086,"uuid":"234167893","full_name":"cmfcmf/docusaurus-search-local","owner":"cmfcmf","description":"Offline / Local Search for Docusaurus v2. Try it live at:","archived":false,"fork":false,"pushed_at":"2024-11-23T16:28:44.000Z","size":13017,"stargazers_count":466,"open_issues_count":39,"forks_count":68,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-04-03T21:41:37.304Z","etag":null,"topics":["docusaurus","lunrjs","plugin","search"],"latest_commit_sha":null,"homepage":"https://cmfcmf.github.io/OpenWeatherMap-PHP-API/","language":"JavaScript","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/cmfcmf.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","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},"funding":{"ko_fi":"cmfcmf","custom":["https://www.buymeacoffee.com/cmfcmf"]}},"created_at":"2020-01-15T20:34:41.000Z","updated_at":"2025-03-24T10:12:29.000Z","dependencies_parsed_at":"2024-01-12T21:17:50.683Z","dependency_job_id":"8a0c2fb5-715b-4725-a664-8b178329ea61","html_url":"https://github.com/cmfcmf/docusaurus-search-local","commit_stats":{"total_commits":261,"total_committers":36,"mean_commits":7.25,"dds":"0.26436781609195403","last_synced_commit":"9c4f5f7f592d8ae077ecc5557104125b3f4a59b8"},"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmfcmf%2Fdocusaurus-search-local","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmfcmf%2Fdocusaurus-search-local/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmfcmf%2Fdocusaurus-search-local/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmfcmf%2Fdocusaurus-search-local/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cmfcmf","download_url":"https://codeload.github.com/cmfcmf/docusaurus-search-local/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248338026,"owners_count":21087150,"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","lunrjs","plugin","search"],"created_at":"2024-08-01T12:02:34.795Z","updated_at":"2025-04-11T03:36:49.676Z","avatar_url":"https://github.com/cmfcmf.png","language":"JavaScript","funding_links":["https://ko-fi.com/cmfcmf","https://www.buymeacoffee.com/cmfcmf"],"categories":["JavaScript","Plugins","others"],"sub_categories":["Search"],"readme":"# Offline / Local Search for Docusaurus v2+\n\n![Version](https://img.shields.io/npm/v/@cmfcmf/docusaurus-search-local?style=flat-square)\n![License](https://img.shields.io/npm/l/@cmfcmf/docusaurus-search-local?style=flat-square)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)\n![GitHub issues](https://img.shields.io/github/issues/cmfcmf/docusaurus-search-local?style=flat-square)\n![GitHub last commit](https://img.shields.io/github/last-commit/cmfcmf/docusaurus-search-local?style=flat-square)\n\nOffline / local search for Docusaurus **v2+** that works behind your firewall.\n\nFeature Highlights:\n\n- Supports multiple documentation versions\n- Supports documentation written in languages other than English\n- Highlights search results\n- Customized parsers for docs, blogs, and general pages\n- Lazy-loads the index\n\n![Search in Action](docs/preview.gif)\n\n\u003e Note: We use the open source [algolia/autocomplete](https://github.com/algolia/autocomplete) library for the searchbox.\n\u003e This library is just used as the frontend, and,\n\u003e unlike the default Docusaurus search experience ([algolia/docsearch](https://docsearch.algolia.com/)),\n\u003e **does not connect to any Algolia or third-party servers**.\n\n## Installation\n\n```bash\nnpm install @cmfcmf/docusaurus-search-local\n```\n\nor\n\n```bash\nyarn add @cmfcmf/docusaurus-search-local\n```\n\n## Usage\n\nAdd this plugin to the `plugins` array in `docusaurus.config.js`.\n\n```js\nmodule.exports = {\n  // ...\n  plugins: [require.resolve(\"@cmfcmf/docusaurus-search-local\")],\n\n  // or, if you want to specify options:\n\n  // ...\n  plugins: [\n    [\n      require.resolve(\"@cmfcmf/docusaurus-search-local\"),\n      {\n        // Options here\n      },\n    ],\n  ],\n};\n```\n\nThe following options are available (defaults are shown below):\n\n```js\n{\n  // whether to index docs pages\n  indexDocs: true,\n\n  // Whether to also index the titles of the parent categories in the sidebar of a doc page.\n  // 0 disables this feature.\n  // 1 indexes the direct parent category in the sidebar of a doc page\n  // 2 indexes up to two nested parent categories of a doc page\n  // 3...\n  //\n  // Do _not_ use Infinity, the value must be a JSON-serializable integer.\n  indexDocSidebarParentCategories: 0,\n\n  // Includes parent categories path in search result\n  includeParentCategoriesInPageTitle: false,\n\n  // whether to index blog pages\n  indexBlog: true,\n\n  // whether to index static pages\n  // /404.html is never indexed\n  indexPages: false,\n\n  // language of your documentation, see next section\n  language: \"en\",\n\n  // setting this to \"none\" will prevent the default CSS to be included. The default CSS\n  // comes from autocomplete-theme-classic, which you can read more about here:\n  // https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-theme-classic/\n  // When you want to overwrite CSS variables defined by the default theme, make sure to suffix your\n  // overwrites with `!important`, because they might otherwise not be applied as expected. See the\n  // following comment for more information: https://github.com/cmfcmf/docusaurus-search-local/issues/107#issuecomment-1119831938.\n  style: undefined,\n\n  // The maximum number of search results shown to the user. This does _not_ affect performance of\n  // searches, but simply does not display additional search results that have been found.\n  maxSearchResults: 8,\n\n  // lunr.js-specific settings\n  lunr: {\n    // When indexing your documents, their content is split into \"tokens\".\n    // Text entered into the search box is also tokenized.\n    // This setting configures the separator used to determine where to split the text into tokens.\n    // By default, it splits the text at whitespace and dashes.\n    //\n    // Note: Does not work for \"ja\" and \"th\" languages, since these use a different tokenizer.\n    tokenizerSeparator: /[\\s\\-]+/,\n    // https://lunrjs.com/guides/customising.html#similarity-tuning\n    //\n    // This parameter controls the importance given to the length of a document and its fields. This\n    // value must be between 0 and 1, and by default it has a value of 0.75. Reducing this value\n    // reduces the effect of different length documents on a term’s importance to that document.\n    b: 0.75,\n    // This controls how quickly the boost given by a common word reaches saturation. Increasing it\n    // will slow down the rate of saturation and lower values result in quicker saturation. The\n    // default value is 1.2. If the collection of documents being indexed have high occurrences\n    // of words that are not covered by a stop word filter, these words can quickly dominate any\n    // similarity calculation. In these cases, this value can be reduced to get more balanced results.\n    k1: 1.2,\n    // By default, we rank pages where the search term appears in the title higher than pages where\n    // the search term appears in just the text. This is done by \"boosting\" title matches with a\n    // higher value than content matches. The concrete boosting behavior can be controlled by changing\n    // the following settings.\n    titleBoost: 5,\n    contentBoost: 1,\n    tagsBoost: 3,\n    parentCategoriesBoost: 2, // Only used when indexDocSidebarParentCategories \u003e 0\n  }\n}\n```\n\nYou can now use the search bar to search your documentation.\n\n**Important: Search only works for the statically built documentation (i.e., after you ran `npm run docusaurus build` in your documentation folder).**\n\n**Search does **not** work in development (i.e., when running `npm run docusaurus start`).**\nIf you want to test search locally, first build the documentation with `npm run docusaurus build`, and then serve it via `npm run docusaurus serve`.\n\n### Non-English Documentation\n\nUse the `language` option if your documentation is not written in English. You can either specify a single language or an array of multiple languages.\nThe following languages are available:\n\n    ar, da, de, en, es, fi, fr, hi, hu, it, ja, nl, no, pt, ro, ru, sv, th, tr, vi, zh\n\n**Important: For Chinese language support (`zh`), you also have to install the `nodejieba` npm package at `^2.5.0 || ^3.0.0`.**\n\n### Documentation Versions\n\nDocumentation versions created with the official Docusaurus docs plugin are supported.\nThe search bar defaults to the latest version (not `next`, but the latest version defined in `versions.json`) when not on a documentation page (e.g., when looking at a blog post or a static page).\nIf the user visits a documentation page, the version is extracted from the page and search will only search the documentation of that version.\nThe searchbar placeholder text always reflects the currently detected documentation version.\n\n### Internationalization\n\nThis plugin supports documentation using [Docusaurus i18n](https://docusaurus.io/docs/i18n/introduction) out of the box..\nPlease contribute additional translations by creating a new translation file in the [codeTranslations](packages/docusaurus-search-local/codeTranslations) subfolder and submitting a PR.\n\nYou can also adjust translations by modifiying the translations in `\u003cyourfolder\u003e/i18n/\u003clocale\u003e/code.json` that start with `cmfcmf/d-s-l.`.\nRead more at: https://docusaurus.io/docs/i18n/tutorial#translate-json-files\n\n### Debugging\n\nIf building your documentation produces an error, you can build it in debug mode to figure out\nwhich page is causing it. To do so, simply set the `DEBUG` environment variable when building\nyour documentation: `DEBUG=1 npm run docusaurus build`.\n\n## CONTRIBUTING\n\nPlease see the [CONTRIBUTING.md](CONTRIBUTING.md) file for further information.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmfcmf%2Fdocusaurus-search-local","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcmfcmf%2Fdocusaurus-search-local","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmfcmf%2Fdocusaurus-search-local/lists"}