feat(v2): add baseUrlIssueBanner configuration to disable banner (#3802)

* add baseUrlIssueBanner configuration

* handle review
This commit is contained in:
Sébastien Lorber 2020-11-23 18:54:13 +01:00 committed by GitHub
parent 9e314bcb11
commit 746a19f25b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 140 additions and 96 deletions

View file

@ -424,3 +424,27 @@ module.exports = {
titleDelimiter: '🦖', // Defaults to `|`
};
```
### `baseUrlIssueBanner`
- Type: `boolean`
When enabled, will show a banner in case your site can't load its CSS or JavaScript files, which is a very common issue, often related to a wrong `baseUrl` in site config.
Example:
```js title="docusaurus.config.js"
module.exports = {
baseUrlIssueBanner: true, // Defaults to `true`
};
```
![baseUrlIssueBanner](/img/baseUrlIssueBanner.png)
:::caution
This banner need to inline CSS / JS.
If you have a strict [Content Security Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP), you should rather disable it.
:::