webidx
1.0.0
WebIDXは、静的Webサイトのクライアント側の検索エンジンです。
Simple Perl Script(WebIDX.PL)を使用して、静的HTMLファイルのインデックスを含むSQLiteデータベースを生成することで機能します。 SQLiteデータベースは、静的コンテンツとともに公開されます。
検索機能は、SQL.jsを使用してSQLiteファイルにインターフェイスを提供するWebIDX.JSに実装されています。
ここでライブデモを見ることができます。
$ /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.