{"id":13486513,"url":"https://github.com/wzpan/hexo-generator-search","last_synced_at":"2025-04-08T08:16:10.398Z","repository":{"id":2001028,"uuid":"41287290","full_name":"wzpan/hexo-generator-search","owner":"wzpan","description":"A plugin to generate search data for Hexo.","archived":false,"fork":false,"pushed_at":"2024-04-11T07:59:10.000Z","size":68,"stargazers_count":467,"open_issues_count":10,"forks_count":86,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-10-29T22:52:34.814Z","etag":null,"topics":["hexo","plugin","search","search-engine"],"latest_commit_sha":null,"homepage":"","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/wzpan.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,"publiccode":null,"codemeta":null}},"created_at":"2015-08-24T06:54:04.000Z","updated_at":"2024-10-22T09:08:03.000Z","dependencies_parsed_at":"2024-06-18T13:06:04.643Z","dependency_job_id":null,"html_url":"https://github.com/wzpan/hexo-generator-search","commit_stats":{"total_commits":71,"total_committers":16,"mean_commits":4.4375,"dds":0.5352112676056338,"last_synced_commit":"9c3b73c75caa72071aa7a06061187dcbf6e39555"},"previous_names":["paichyperiondev/hexo-generator-search"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wzpan%2Fhexo-generator-search","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wzpan%2Fhexo-generator-search/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wzpan%2Fhexo-generator-search/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wzpan%2Fhexo-generator-search/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wzpan","download_url":"https://codeload.github.com/wzpan/hexo-generator-search/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247801175,"owners_count":20998339,"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","plugin","search","search-engine"],"created_at":"2024-07-31T18:00:47.485Z","updated_at":"2025-04-08T08:16:10.362Z","avatar_url":"https://github.com/wzpan.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","others"],"sub_categories":[],"readme":"# hexo-generator-search\n\n[![npm](https://img.shields.io/npm/v/hexo-generator-search.svg)](https://www.npmjs.com/package/hexo-generator-search)\n[![npm](https://img.shields.io/npm/dm/hexo-generator-search.svg)](https://www.npmjs.com/package/hexo-generator-search)\n\nGenerate search data for Hexo 3.x and 4.x. This plugin is used for generating a search index file, which contains all the neccessary data of your articles that you can use to write a local search engine for your blog. Supports both XML and JSON format output.\n\n- [Demo](http://www.hahack.com/hexo-theme-freemind-blog/) - try out the search engine in this site.\n- [Demo JSON output](https://github.com/PaicHyperionDev/hexo-generator-search/blob/master/demo_output/search.json)\n- [Demo XML output](https://github.com/PaicHyperionDev/hexo-generator-search/blob/master/demo_output/search.xml)\n\n## Install\n\n``` bash\n$ npm install hexo-generator-search --save\n```\n\n## Options\n\nYou can configure this plugin in your root `_config.yml`.\n\n``` yaml\nsearch:\n  path: search.xml\n  field: post\n  content: true\n  template: ./search.xml\n```\n\n- **path** - file path. By default is `search.xml` . If the file extension is `.json`, the output format will be JSON. Otherwise XML format file will be exported.\n- **field** - the search scope you want to search, you can chose:\n  * **post** (Default) - will only covers all the posts of your blog.\n  * **page** - will only covers all the pages of your blog.\n  * **all** - will covers 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- **template** (Optional) - path to a custom XML template\n\n## Exclude indexing\n\nTo exclude a certain post or page from being indexed, you can simply insert `indexing: false` setting at the top of its front-matter, *e.g.*:\n\n```\ntitle: \"Code Highlight\"\ndate: \"2014-03-15 20:17:16\"\ntags: highlight\ncategories: Demo\ndescription: \"A collection of Hello World applications from helloworld.org.\"\ntoc: true\nindexing: false\n---\n```\n\nThen the generated result will not contain this post or page.\n\n## FAQ\n\n### What's this plugin supposed to do? \n\nThis plugin is used for generating a xml / json 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 Ajax and jQuery and would like to write your own search engine. You can implement one by yourself according to the example theme I give. Read the [source code](https://github.com/wzpan/hexo-theme-freemind) of this theme. Generally there are 3 steps:\n  1. write a [search view](https://github.com/wzpan/hexo-theme-freemind/blob/master/layout/_widget/search.ejs#L8). This is the place for displaying a search form and search results ;\n  2. write a [search script](https://github.com/wzpan/hexo-theme-freemind/blob/master/source/js/search.js). This script tells the browser how to grab search data and filter out contents what we're searching;\n  3. tell hexo to [connect the above two part](https://github.com/wzpan/hexo-theme-freemind/blob/master/layout/_partial/after_footer.ejs#L22).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwzpan%2Fhexo-generator-search","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwzpan%2Fhexo-generator-search","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwzpan%2Fhexo-generator-search/lists"}