gitbook-plugin-search-fetch

0.1.1 • Public • Published

gitbook-plugin-search-fetch

A powerful search plugin for GitBook.

Features

* Allows you to pull search results from a remote server.
* Support jsonp data type.

Use this plugin

Before use this plugin, you should disable the default search plugin first, Here is a book.json configuration example:

{
    plugins: ["-lunr", "-search", "search-fetch"]
}

Run gitbook serve

Note: Only gitbook >= 3.0.0 support

Configure

{
    searchFetch: {
        url: 'http://yoursearchcgi.com/?q=', // required | your search cgi 
        dataType: 'jsonp', // option | default value: "json"
        jsonp: '', // option | default value: "callback"
        jsonpCallback: '' // option | default value: "
    }
    
}

Expected return data format:

{
    "./": { // target page path
        "url": "./", // target page path
        "title": "your title",
        "keywords": "your keywords",
        "body": "your content"
    }
}

Inspired by

Readme

Keywords

none

Package Sidebar

Install

npm i gitbook-plugin-search-fetch

Weekly Downloads

1

Version

0.1.1

License

Apache-2.0

Unpacked Size

2.96 MB

Total Files

12

Last publish

Collaborators

  • zzbo