Welcome to gitbook-plugin-multilingual-index 👋

npm:version npm:download npm:prerequisite github:documentation github:maintenance npm:license github:snodreams1006 website:snodreams1006.tech 微信公众号:雪之梦技术驿站-brightgreen.svg

customize multilingual home pages

🏠 Homepage

Screenshot

multilingual-index-use-preview.png

Usage

Step #1 - Update book.json file

  1. In you gitbook's book.json file, add multilingual-index to plugins list.
  2. In pluginsConfig, Set enableSuper as false to disable default home page,and add index value to customize multilingual home pages. Only relative paths are supported.

Here is simplest example :

{
    "plugins": ["multilingual-index"],
    "pluginsConfig": {
        "multilingual-index": {
            "enableSuper": false,
            "index":"index.html"
        }
    }
}

Please refer to the following configuration item for more details :

"enableSuper": {
  "type": "boolean",
  "title": "inherit from super",
  "required": false,
  "default": true
},
"index": {
  "type": "string",
  "title": "default index path",
  "required": false
}

Step #2 - gitbook commands

  1. Run gitbook install. It will automatically install multilingual-index gitbook plugin for your book. This is needed only once.
gitbook install

or you can run npm install gitbook-plugin-multilingual-index to install locally.

npm install gitbook-plugin-multilingual-index
  1. Build your book (gitbook build) or serve (gitbook serve) as usual.
gitbook serve

Example

  • Official documentation configuration file

https://github.com/snowdreams1006/gitbook-plugin-multilingual-index/blob/master/docs/book.json

{
    "plugins": ["multilingual-index"],
    "pluginsConfig": {
        "multilingual-index": {
            "enableSuper": false,
            "index":"index.html"
        }
    }
}

multilingual-index-use-preview.png

  • Official example configuration file

https://github.com/snowdreams1006/gitbook-plugin-multilingual-index/blob/master/example/book.json

{
    "plugins": ["multilingual-index"],
    "pluginsConfig": {
        "multilingual-index": {
            "enableSuper": true,
            "index":"index.html"
        }
    }
}

multilingual-index-example-preview.png

Sample book.json file with inheriting the default home page

{
   "plugins": ["multilingual-index"],
    "pluginsConfig": {
        "multilingual-index": {
            "enableSuper": true,
            "index":"index.html"
        }
    }
}

Sample book.json file without inheriting the default home page

{
    "plugins": ["multilingual-index"],
    "pluginsConfig": {
        "multilingual-index": {
            "enableSuper": false,
            "index":"index.html"
        }
    }
}

Author

👤 snowdreams1006

Contributing

Contributions, issues and feature requests are welcome!

Feel free to check issues page.

Show your support

Give a Star if this project helped you!

Copyright © 2019 snowdreams1006.

This project is MIT licensed.

Author: 雪之梦技术驿站
Url: https://snowdreams1006.github.io/gitbook-plugin-multilingual-index/en/
Source: 雪之梦技术驿站
This article was originally published in「雪之梦技术驿站」,Reproduced please indicate the source, thank you for cooperation!

https://snowdreams1006.github.io/snowdreams1006-wechat-open.png

results matching ""

    No results matching ""