mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-28 05:58:38 +02:00
feat(theme-classic): themeConfig navbar/footer logos accept className/style + update Meta Open-Source Logo (#7643)
This commit is contained in:
parent
a989a1d17e
commit
42ab07f62f
14 changed files with 102 additions and 83 deletions
|
@ -300,6 +300,18 @@ const CustomCssSchema = Joi.alternatives()
|
|||
.try(Joi.array().items(Joi.string().required()), Joi.string().required())
|
||||
.optional();
|
||||
|
||||
const LogoSchema = Joi.object({
|
||||
alt: Joi.string().allow(''),
|
||||
src: Joi.string().required(),
|
||||
srcDark: Joi.string(),
|
||||
width: Joi.alternatives().try(Joi.string(), Joi.number()),
|
||||
height: Joi.alternatives().try(Joi.string(), Joi.number()),
|
||||
href: Joi.string(),
|
||||
target: Joi.string(),
|
||||
style: Joi.object(),
|
||||
className: Joi.string(),
|
||||
});
|
||||
|
||||
export const ThemeConfigSchema = Joi.object<ThemeConfig>({
|
||||
// TODO temporary (@alpha-58)
|
||||
// @ts-expect-error: forbidden
|
||||
|
@ -344,28 +356,11 @@ export const ThemeConfigSchema = Joi.object<ThemeConfig>({
|
|||
.items(NavbarItemSchema)
|
||||
.default(DEFAULT_CONFIG.navbar.items),
|
||||
title: Joi.string().allow('', null),
|
||||
logo: Joi.object({
|
||||
alt: Joi.string().allow(''),
|
||||
src: Joi.string().required(),
|
||||
srcDark: Joi.string(),
|
||||
width: Joi.alternatives().try(Joi.string(), Joi.number()),
|
||||
height: Joi.alternatives().try(Joi.string(), Joi.number()),
|
||||
href: Joi.string(),
|
||||
target: Joi.string(),
|
||||
}),
|
||||
logo: LogoSchema,
|
||||
}).default(DEFAULT_CONFIG.navbar),
|
||||
footer: Joi.object({
|
||||
style: Joi.string().equal('dark', 'light').default('light'),
|
||||
logo: Joi.object({
|
||||
alt: Joi.string().allow(''),
|
||||
src: Joi.string().required(),
|
||||
srcDark: Joi.string(),
|
||||
// TODO infer this from reading the image
|
||||
width: Joi.alternatives().try(Joi.string(), Joi.number()),
|
||||
height: Joi.alternatives().try(Joi.string(), Joi.number()),
|
||||
href: Joi.string(),
|
||||
target: Joi.string(),
|
||||
}),
|
||||
logo: LogoSchema,
|
||||
copyright: Joi.string(),
|
||||
links: Joi.alternatives(
|
||||
Joi.array().items(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue