Custom multilingual home page

Chinese | English

🏠 The home page

  • Making: snowdreams1006. Making. IO/gitbook – plu…
  • GitLab: snowdreams1006. GitLab. IO/gitbook – plu…
  • Gitee: snowdreams1006. Gitee. IO/gitbook – plu…

Screen capture

usage

Step # 1 – Updatebook.jsonfile

  1. In your Gitbookbook.jsonIn the file, willmultilingual-indexAdded to thepluginsIn the list.
  2. inpluginsConfigThat will beenableSuperSet tofalseYou can disable the default home page and addindexValue to custom multilingual home page. Only relative paths are supported.

This is the simplest example:

{
    "plugins": ["multilingual-index"]."pluginsConfig": {
        "multilingual-index": {
            "enableSuper": false."index":"index.html"}}}Copy the code

For more details, refer to the following configuration items:

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

Step # 2 -gitbook command

  1. rungitbook install. It will automatically install for your Gitbookmultilingual-indexGitbook plug-in. It only takes once.
gitbook install
Copy the code

Alternatively, you can run NPM install gitbook-plugin-multilingual-index to install locally.

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

The sample

  • Official document configuration file

Github.com/snowdreams1…

{
    "plugins": ["multilingual-index"]."pluginsConfig": {
        "multilingual-index": {
            "enableSuper": false."index":"index.html"}}}Copy the code

  • Official sample configuration file

Github.com/snowdreams1…

{
    "plugins": ["multilingual-index"]."pluginsConfig": {
        "multilingual-index": {
            "enableSuper": true."index":"index.html"}}}Copy the code

An example of inheriting the default home pagebook.jsonfile

{
   "plugins": ["multilingual-index"]."pluginsConfig": {
        "multilingual-index": {
            "enableSuper": true."index":"index.html"}}}Copy the code

An example of not inheriting the default home pagebook.jsonfile

{
    "plugins": ["multilingual-index"]."pluginsConfig": {
        "multilingual-index": {
            "enableSuper": false."index":"index.html"}}}Copy the code

The author

👤 snowdreams1006

contribution

Contributions, questions and feature requests are welcome!

Always check the problem page.

support

If this project has been helpful to you, please give me a star!

copyright

Copyright ©2019 SnowDreams1006. All Rights Reserved.

The project is licensed by MIT.

If you feel that this article is helpful to you, welcome to like the message to tell me, your encouragement is my motivation to continue to create, might as well pay attention to the personal public number “snow dream technology station”, regularly update quality articles!