Skip to content

Commit

Permalink
feat: allow specifying custom target for FooterLogo (#7557)
Browse files Browse the repository at this point in the history
Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
  • Loading branch information
vannyle and Josh-Cena committed Jun 3, 2022
1 parent 9d0bf2e commit 5444a23
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
Expand Up @@ -102,6 +102,7 @@ describe('themeConfig', () => {
alt: 'Facebook Open Source Logo',
src: 'img/oss_logo.png',
href: 'https://opensource.facebook.com',
target: '_self',
},
copyright: `Copyright © ${new Date().getFullYear()} Facebook, Inc. Built with Docusaurus.`,
},
Expand Down
Expand Up @@ -32,7 +32,10 @@ function LogoImage({logo}: Props) {

export default function FooterLogo({logo}: Props): JSX.Element {
return logo.href ? (
<Link href={logo.href} className={styles.footerLogoLink}>
<Link
href={logo.href}
className={styles.footerLogoLink}
target={logo.target}>
<LogoImage logo={logo} />
</Link>
) : (
Expand Down
Expand Up @@ -364,6 +364,7 @@ export const ThemeConfigSchema = Joi.object<ThemeConfig>({
width: Joi.alternatives().try(Joi.string(), Joi.number()),
height: Joi.alternatives().try(Joi.string(), Joi.number()),
href: Joi.string(),
target: Joi.string(),
}),
copyright: Joi.string(),
links: Joi.alternatives(
Expand Down
Expand Up @@ -75,6 +75,7 @@ export type FooterLogo = {
srcDark?: string;
width?: string | number;
height?: string | number;
target?: string;
href?: string;
};

Expand Down

0 comments on commit 5444a23

Please sign in to comment.