Configuração do tema
This configuration applies to all main themes.
Common
Color mode
O tema clássico fornece, por padrão, suporte ao modo claro e escuro, com um botão de navegação para o usuário.
It is possible to customize the color mode support within the colorMode
object.
Campos aceitos:
Nome | Type | Padrão | Descrição |
---|---|---|---|
defaultMode | 'light' | 'dark' | 'light' | The color mode when user first visits the site. |
disableSwitch | boolean | false | Hides the switch in the navbar. Useful if you want to support a single color mode. |
respectPrefersColorScheme | boolean | false | Whether to use the prefers-color-scheme media-query, using user system preferences, instead of the hardcoded defaultMode . |
Configuração de exemplo:
module.exports = {
themeConfig: {
colorMode: {
defaultMode: 'light',
disableSwitch: false,
respectPrefersColorScheme: false,
},
},
};
With respectPrefersColorScheme: true
, the defaultMode
is overridden by user system preferences.
Se você deseja oferecer suporte a apenas um modo de cor, provavelmente deseja ignorar as preferências do sistema do usuário.
Meta image
You can configure a default image that will be used for your meta tag, in particular og:image
and twitter:image
.
Campos aceitos:
Nome | Type | Padrão | Descrição |
---|---|---|---|
image | string | undefined | The meta image URL for the site. Relative to your site's "static" directory. Cannot be SVGs. Também podem ser URLs externos. |
Configuração de exemplo:
module.exports = {
themeConfig: {
image: 'img/docusaurus.png',
},
};
Metadata
You can configure additional HTML metadata (and override existing ones).
Campos aceitos:
Nome | Type | Padrão | Descrição |
---|---|---|---|
metadata | Metadata[] | [] | Any field will be directly passed to the <meta /> tag. Possible fields include id , name , property , content , itemprop , etc. |
Configuração de exemplo:
module.exports = {
themeConfig: {
metadata: [{name: 'twitter:card', content: 'summary'}],
},
};