webidx
1.0.0
WebIdx는 정적 웹 사이트를위한 클라이언트 측 검색 엔진입니다.
간단한 PERL 스크립트 (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.