{"id":15015750,"url":"https://github.com/gbxyz/webidx","last_synced_at":"2025-04-09T19:32:24.004Z","repository":{"id":218768184,"uuid":"747301794","full_name":"gbxyz/webidx","owner":"gbxyz","description":"webidx is a client-side search engine for static websites.","archived":false,"fork":false,"pushed_at":"2025-03-09T18:18:26.000Z","size":38,"stargazers_count":58,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-23T21:23:02.050Z","etag":null,"topics":["javascript","perl","search-engine","sqlite","static-site","web"],"latest_commit_sha":null,"homepage":"https://github.com/gbxyz/webidx","language":"Perl","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gbxyz.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":"2024-01-23T17:00:37.000Z","updated_at":"2025-03-09T18:18:30.000Z","dependencies_parsed_at":"2024-01-23T18:48:59.413Z","dependency_job_id":"a0ac9957-9baa-412c-8ac8-ef04a4085116","html_url":"https://github.com/gbxyz/webidx","commit_stats":null,"previous_names":["gbxyz/webidx"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbxyz%2Fwebidx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbxyz%2Fwebidx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbxyz%2Fwebidx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbxyz%2Fwebidx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gbxyz","download_url":"https://codeload.github.com/gbxyz/webidx/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248097961,"owners_count":21047345,"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":["javascript","perl","search-engine","sqlite","static-site","web"],"created_at":"2024-09-24T19:47:52.874Z","updated_at":"2025-04-09T19:32:23.992Z","avatar_url":"https://github.com/gbxyz.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# webidx\n\nwebidx is a client-side search engine for static websites.\n\nThe search functionality is implemented in [webidx.js](webidx.js), which uses [sql.js](https://github.com/sql-js/sql.js) to provide an interface to an SQLite database.\n\nThe database is generated by a simple Perl script ([webidx.pl](webidx.pl)) that should be run as part of the site build pipeline (eg after `jekyll build` or whatever). The SQLite database should then be published alongside the static content.\n\nYou can see a live demo of it [here](https://gavinbrown.xyz/webidx-demo/).\n\n## How to use it\n\n1. use [webidx.pl](webidx.pl) to generate the index:\n\n```\n$ /path/to/webidx.pl -x index.html -x archives.html --xP secret_files -o https://example.com -z . ./index.db\n```\n\nYou can run `webidx.pl --help` to see all the available command-line options.\n\n2. Include [sql.js](https://cdnjs.com/libraries/sql.js), [pako](https://cdnjs.com/libraries/pako) and [webidx.js](webidx.js) in your web page:\n\n```html\n\u003cscript src=\"https://cdnjs.cloudflare.com/ajax/libs/sql.js/1.12.0/sql-wasm.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"https://cdnjs.cloudflare.com/ajax/libs/pako/2.1.0/pako.min.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"/path/to/webidx.js\"\u003e\u003c/script\u003e\n```\n\n3. Create a search form:\n\n```html\n\u003cform onsubmit=\"window.webidx.search({dbfile:'/webidx.db.gz',query:document.getElementById('q').value});return false;\"\u003e\n  \u003cinput id=\"q\" type=\"search\"\u003e\n\u003c/form\u003e\n```\n\nWhen the user hits the return key in the search box, a modal dialog will pop up containing search results!\n\nThe object that's passed to `window.webidx.search()` can have the following properties:\n\n* `dbfile`: URL of the SQLite database file\n* `query`: search query\n* `resultCallback`: a callback which is passed an array of search results. Each result is an object with the `title` and `url` properties. If not defined, a modal dialog will be displayed.\n* `errorCallback`: a callback which is passed any error string as an argument.\n* `titleSuffix`: a string to be removed from the end of page titles.\n* `titlePrefix`: a string to be removed from the beginning of page titles.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgbxyz%2Fwebidx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgbxyz%2Fwebidx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgbxyz%2Fwebidx/lists"}