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.json
file
- In your Gitbook
book.json
In the file, willmultilingual-index
Added to theplugins
In the list. - in
pluginsConfig
That will beenableSuper
Set tofalse
You can disable the default home page and addindex
Value 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
- run
gitbook install
. It will automatically install for your Gitbookmultilingual-index
Gitbook 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
- 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.json
file
{
"plugins": ["multilingual-index"]."pluginsConfig": {
"multilingual-index": {
"enableSuper": true."index":"index.html"}}}Copy the code
An example of not inheriting the default home pagebook.json
file
{
"plugins": ["multilingual-index"]."pluginsConfig": {
"multilingual-index": {
"enableSuper": false."index":"index.html"}}}Copy the code
The author
👤 snowdreams1006
- Website: snowdreams1006. Tech
- Making: @ snowdreams1006
- Email: [email protected]
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!