mirror of
https://github.com/zhigang1992/docsify.git
synced 2026-03-27 02:34:13 +08:00
feat(fetch): Add fallback languages configuration. (#402)
fallbackLanguages give the possibility to configure a list of languages which must used the default language when a page is missing in the requested language.
This commit is contained in:
committed by
cinwell.li
parent
278a75ebd5
commit
ecc0e04c70
@@ -413,3 +413,25 @@ window.$docsify = {
|
||||
ext: '.md'
|
||||
};
|
||||
```
|
||||
|
||||
## fallbackLanguages
|
||||
|
||||
* type: `Array<string>`
|
||||
|
||||
List of languages that will fallback to the default language when a page is request and didn't exists for the given local.
|
||||
|
||||
Example:
|
||||
|
||||
- try to fetch the page of `/de/overview`. If this page exists, it'll be displayed
|
||||
- then try to fetch the default page `/overview` (depending on the default language). If this page exists, it'll be displayed
|
||||
- then display 404 page.
|
||||
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
fallbackLanguages: [
|
||||
"fr",
|
||||
"de"
|
||||
]
|
||||
};
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user