webidx
1.0.0
WebIdx是靜態網站的客戶端搜索引擎。
它通過使用簡單的Perl腳本(WebIdx.pl)來生成包含靜態HTML文件索引的SQLite數據庫。然後,SQLite數據庫與靜態內容一起發布。
搜索功能是在使用SQL.JS的WebIdx.js中實現的,該功能為SQLite文件提供接口。
您可以在這裡看到一個現場演示。
$ /path/to/webidx.pl -x index.html -x archives.html --xP secret_files -o https://example.com -z . ./index.db
You can run webidx.pl --help to see all the available command-line options.
< script src =" https://cdnjs.cloudflare.com/ajax/libs/sql.js/1.10.1/sql-wasm.js " > </ script >
< script src =" https://cdnjs.cloudflare.com/ajax/libs/pako/2.1.0/pako.min.js " > </ script >
< script src =" /path/to/webidx.js " > </ script > < form onsubmit =" window.webidx.search({dbfile:'/webidx.db.gz',query:document.getElementById('q').value});return false; " >
< input id =" q " type =" search " >
</ form >當用戶鍵入搜索框中的返回鍵時,將彈出一個包含搜索結果的模態對話框!
The object that's passed to window.webidx.search() can have the following properties:
dbfile : URL of the SQLite database filequery : search queryresultCallback : a callback which is passed an array of search results. Each result is an object with the title and url properties.如果未定義,將顯示一個模態對話框。errorCallback : a callback which is passed any error string as an argument.titleSuffix : a string to be removed from the end of page titles.titlePrefix : a string to be removed from the beginning of page titles.