{"id":22300335,"url":"https://github.com/dropseed/pitchfork","last_synced_at":"2025-07-29T02:31:41.430Z","repository":{"id":39153464,"uuid":"304423466","full_name":"dropseed/pitchfork","owner":"dropseed","description":"Client-side static site search with index generation and a UI","archived":false,"fork":false,"pushed_at":"2023-07-03T16:10:40.000Z","size":1585,"stargazers_count":5,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-30T14:55:37.191Z","etag":null,"topics":["search","static-site","ui"],"latest_commit_sha":null,"homepage":"https://www.dropseed.io/pitchfork","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/dropseed.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}},"created_at":"2020-10-15T19:05:16.000Z","updated_at":"2024-10-23T10:52:52.000Z","dependencies_parsed_at":"2023-02-02T18:46:25.676Z","dependency_job_id":null,"html_url":"https://github.com/dropseed/pitchfork","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dropseed%2Fpitchfork","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dropseed%2Fpitchfork/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dropseed%2Fpitchfork/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dropseed%2Fpitchfork/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dropseed","download_url":"https://codeload.github.com/dropseed/pitchfork/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227971951,"owners_count":17849421,"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":["search","static-site","ui"],"created_at":"2024-12-03T18:10:33.150Z","updated_at":"2024-12-03T18:10:33.820Z","avatar_url":"https://github.com/dropseed.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pitchfork\n\n\u003cimg src=\"https://www.dropseed.dev/pitchfork/pitchfork-logo.svg\" width=\"100\" height=\"100\" align=\"right\" /\u003e\n\nPitchfork is a complete, local search solution for static sites. It knows how to index HTML content, uses [Lunr](https://lunrjs.com/) to search it, and [Mustache](https://github.com/janl/mustache.js/) for simple front-end customization.\n\nIt's like [Algolia DocSearch](https://docsearch.algolia.com/), but you don't have to rely on an external service.\n\n![Pitchfork search demo](https://www.dropseed.dev/pitchfork/pitchfork-ui-demo.gif)\n\n## Quick install using CDN and npx\n\nInclude pitchfork on your website:\n\n```html\n\u003cinput data-pitchfork-input type=\"text\" placeholder=\"Search\"\u003e\n\u003cdiv data-pitchfork-results style=\"display: none;\"\u003e\n    \u003cscript type=\"x-tmpl-mustache\"\u003e\n    {{#results}}\n    \u003ca href=\"{{url}}\"\u003e\n        \u003cdiv\u003e{{{highlights.title}}}\u003c/div\u003e\n        \u003cdiv\u003e{{{highlights.text}}}\u003c/div\u003e\n    \u003c/a\u003e\n    {{/results}}\n\n    {{^results}}\n    \u003cdiv\u003eNo matches, keep typing...\u003c/div\u003e\n    {{/results}}\n    \u003c/script\u003e\n\u003c/div\u003e\n\n\u003cscript src=\"https://unpkg.com/@dropseed/pitchfork@\u003c1.0.0/dist/search.js\"\u003e\u003c/script\u003e\n```\n\nCreate an index (without installing pitchfork to your project):\n\n```sh\n$ npx -p @dropseed/pitchfork pitchfork index your_html_directory -c .dom_selector_for_main_content\n```\n\n## Full install\n\nPitchfork is on [npm](https://www.npmjs.com/package/@dropseed/pitchfork).\n\n```sh\n$ npm install @dropseed/pitchfork\n```\n\nGenerate your index:\n\n```sh\n$ pitchfork index your_html_directory -c .dom_selector_for_main_content\n```\n\nAnd include it in your JS bundle:\n\n```js\nrequire(\"@dropseed/pitchfork/search\")\n```\n\n## HTML and templating\n\nThis is a more complete example showing all of the `data-pitchfork` options.\n\n```html\n\u003cinput data-pitchfork-input type=\"text\" placeholder=\"Search\"\u003e\n\u003cdiv data-pitchfork-results\n    data-pitchfork-index-url=\"/search-index.json\"\n    data-pitchfork-truncate=\"140\"\n    data-pitchfork-highlight-class=\"bg-yellow-200\"\n    data-pitchfork-active-class=\"bg-gray-100\"\n    style=\"display: none;\"\u003e\n    \u003cscript type=\"x-tmpl-mustache\"\u003e\n    {{#results}}\n    \u003ca href=\"{{url}}\" class=\"block px-4 py-2 border-b border-gray-200 hover:bg-gray-100\"\u003e\n        \u003cdiv class=\"font-medium\"\u003e\n            {{{highlights.title}}}\n        \u003c/div\u003e\n        \u003cdiv class=\"text-sm text-gray-700\"\u003e\n            {{{highlights.text}}}\n        \u003c/div\u003e\n    \u003c/a\u003e\n    {{/results}}\n\n    {{^results}}\n    \u003cp\u003eNo matches, keep typing...\u003c/p\u003e\n    {{/results}}\n    \u003c/script\u003e\n\u003c/div\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdropseed%2Fpitchfork","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdropseed%2Fpitchfork","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdropseed%2Fpitchfork/lists"}