mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-28 14:08:21 +02:00
feat: allow specifying custom target for FooterLogo (#7557)
Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
This commit is contained in:
parent
9d0bf2e090
commit
5444a230cf
4 changed files with 7 additions and 1 deletions
|
@ -102,6 +102,7 @@ describe('themeConfig', () => {
|
||||||
alt: 'Facebook Open Source Logo',
|
alt: 'Facebook Open Source Logo',
|
||||||
src: 'img/oss_logo.png',
|
src: 'img/oss_logo.png',
|
||||||
href: 'https://opensource.facebook.com',
|
href: 'https://opensource.facebook.com',
|
||||||
|
target: '_self',
|
||||||
},
|
},
|
||||||
copyright: `Copyright © ${new Date().getFullYear()} Facebook, Inc. Built with Docusaurus.`,
|
copyright: `Copyright © ${new Date().getFullYear()} Facebook, Inc. Built with Docusaurus.`,
|
||||||
},
|
},
|
||||||
|
|
|
@ -32,7 +32,10 @@ function LogoImage({logo}: Props) {
|
||||||
|
|
||||||
export default function FooterLogo({logo}: Props): JSX.Element {
|
export default function FooterLogo({logo}: Props): JSX.Element {
|
||||||
return logo.href ? (
|
return logo.href ? (
|
||||||
<Link href={logo.href} className={styles.footerLogoLink}>
|
<Link
|
||||||
|
href={logo.href}
|
||||||
|
className={styles.footerLogoLink}
|
||||||
|
target={logo.target}>
|
||||||
<LogoImage logo={logo} />
|
<LogoImage logo={logo} />
|
||||||
</Link>
|
</Link>
|
||||||
) : (
|
) : (
|
||||||
|
|
|
@ -364,6 +364,7 @@ export const ThemeConfigSchema = Joi.object<ThemeConfig>({
|
||||||
width: Joi.alternatives().try(Joi.string(), Joi.number()),
|
width: Joi.alternatives().try(Joi.string(), Joi.number()),
|
||||||
height: Joi.alternatives().try(Joi.string(), Joi.number()),
|
height: Joi.alternatives().try(Joi.string(), Joi.number()),
|
||||||
href: Joi.string(),
|
href: Joi.string(),
|
||||||
|
target: Joi.string(),
|
||||||
}),
|
}),
|
||||||
copyright: Joi.string(),
|
copyright: Joi.string(),
|
||||||
links: Joi.alternatives(
|
links: Joi.alternatives(
|
||||||
|
|
|
@ -75,6 +75,7 @@ export type FooterLogo = {
|
||||||
srcDark?: string;
|
srcDark?: string;
|
||||||
width?: string | number;
|
width?: string | number;
|
||||||
height?: string | number;
|
height?: string | number;
|
||||||
|
target?: string;
|
||||||
href?: string;
|
href?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue