{"id":13614785,"url":"https://github.com/next-theme/hexo-generator-searchdb","last_synced_at":"2025-08-20T06:32:16.328Z","repository":{"id":40415639,"uuid":"253151456","full_name":"next-theme/hexo-generator-searchdb","owner":"next-theme","description":"🔍 Seach data generator plugin for Hexo.","archived":false,"fork":false,"pushed_at":"2024-04-14T01:45:49.000Z","size":41,"stargazers_count":57,"open_issues_count":6,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-04-14T04:43:51.748Z","etag":null,"topics":["hexo","hexo-plugin","search-engine"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/hexo-generator-searchdb","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/next-theme.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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}},"created_at":"2020-04-05T03:57:09.000Z","updated_at":"2024-04-20T01:36:14.020Z","dependencies_parsed_at":"2023-01-30T19:16:07.568Z","dependency_job_id":"dd87d738-2a05-463e-88d5-70bb601c36e3","html_url":"https://github.com/next-theme/hexo-generator-searchdb","commit_stats":{"total_commits":49,"total_committers":3,"mean_commits":"16.333333333333332","dds":"0.22448979591836737","last_synced_commit":"1f2a3ce6546f2ecc801c14e424d5d2f16202616e"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/next-theme%2Fhexo-generator-searchdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/next-theme%2Fhexo-generator-searchdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/next-theme%2Fhexo-generator-searchdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/next-theme%2Fhexo-generator-searchdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/next-theme","download_url":"https://codeload.github.com/next-theme/hexo-generator-searchdb/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229827695,"owners_count":18130390,"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":["hexo","hexo-plugin","search-engine"],"created_at":"2024-08-01T20:01:05.654Z","updated_at":"2025-08-20T06:32:16.319Z","avatar_url":"https://github.com/next-theme.png","language":"JavaScript","funding_links":[],"categories":["Plugins"],"sub_categories":["Hexo Plugins"],"readme":"# hexo-generator-searchdb\n\n[![Build Status][github-image]][github-url]\n[![npm-image]][npm-url]\n[![hexo-image]][hexo-url]\n[![lic-image]](LICENSE)\n\nSeach data generator plugin for Hexo.\n\nThis plugin is used for generating a search index file, which contains all the necessary data of your articles that you can use to write a local search engine for your blog. Supports both JSON and XML format output. The JSON format is recommended, as it has a smaller size and avoids encoding issues.\n\n## Install\n\n![size-image]\n[![dm-image]][npm-url]\n[![dt-image]][npm-url]\n\n```bash\nnpm install hexo-generator-searchdb\n```\n\n## Options\n\nYou can configure this plugin in your root `_config.yml`. All the arguments are optional.\n\n``` yaml\nsearch:\n  path: search.json\n  field: post\n  content: true\n  format: striptags\n```\n\n- **path** - the path to the generated database file. Supports `.json` and `.xml` formats. If no file extension is provided, JSON format will be used by default.\n- **field** - the search scope you want to search, you can chose:\n  * **post** (Default) - will only cover all the posts of your blog.\n  * **page** - will only cover all the pages of your blog.\n  * **all** - will cover all the posts and pages of your blog.\n- **content** - whether contains the whole content of each article. If `false`, the generated results only cover title and other meta info without mainbody. By default is `true`.\n- **format** - the form of the page contents, options are:\n  * **striptags** (Default) - original html string being minified, and remove all the tags.\n  * **html** - original html string being minified.\n  * **raw** - markdown text of each posts or pages.\n\n## FAQ\n\n### What's this plugin supposed to do?\n\nThis plugin is used for generating a JSON / XML file from your Hexo blog that provides data for searching.\n\n### Where's this file saved to?\n\nAfter executing `hexo g` you will get the generated result at your public folder.\n\n### How to use this plugin in my Hexo blog?\n\nYou have two choices:\n\n* you don't want to write search engine by yourself. There are many themes that take use this plugin for local searching that works out of box.\n* you are familiar with JavaScript and would like to write your own search engine. You can implement one by yourself according to the [template code `search.js`](https://github.com/next-theme/hexo-generator-searchdb/blob/main/dist/search.js). There is no documentation at present, but you can find its usage in the source code of the [theme NexT](https://github.com/next-theme/hexo-theme-next). Generally there are 3 steps:\n  1. write a [search view](https://github.com/next-theme/hexo-theme-next/blob/v8.8.0/layout/_partials/search/localsearch.njk). This is the place for displaying a search form and search results;\n  2. load the `search.js` script via CDN, for example:\n  ```html\n  \u003cscript src=\"https://cdn.jsdelivr.net/npm/hexo-generator-searchdb@1.4.0/dist/search.js\"\u003e\u003c/script\u003e\n  ```\n  A `LocalSearch` class is provided in the `search.js` which tells the browser how to grab search data and filter out contents what we're searching;\n\n  3. write a [search script](https://github.com/next-theme/hexo-theme-next/blob/v8.8.0/source/js/third-party/search/local-search.js), make use of the previous `LocalSearch` class.\n\n[github-image]: https://img.shields.io/github/actions/workflow/status/next-theme/hexo-generator-searchdb/linter.yml?branch=main\u0026style=flat-square\n[npm-image]: https://img.shields.io/npm/v/hexo-generator-searchdb?style=flat-square\n[hexo-image]: https://img.shields.io/badge/hexo-%3E%3D%203.0-blue?style=flat-square\n[lic-image]: https://img.shields.io/npm/l/hexo-generator-searchdb?style=flat-square\n\n[size-image]: https://img.shields.io/github/languages/code-size/next-theme/hexo-generator-searchdb?style=flat-square\n[dm-image]: https://img.shields.io/npm/dm/hexo-generator-searchdb?style=flat-square\n[dt-image]: https://img.shields.io/npm/dt/hexo-generator-searchdb?style=flat-square\n\n[github-url]: https://github.com/next-theme/hexo-generator-searchdb/actions?query=workflow%3ALinter\n[npm-url]: https://www.npmjs.com/package/hexo-generator-searchdb\n[hexo-url]: https://hexo.io\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnext-theme%2Fhexo-generator-searchdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnext-theme%2Fhexo-generator-searchdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnext-theme%2Fhexo-generator-searchdb/lists"}