mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-07 20:07:59 +02:00
fix(v2): unbreak adding of custom HTML metadatas (#4871)
* fix(v2): unbreak adding of custom HTML metadatas * Correct solution * Update website/docusaurus.config.js Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
This commit is contained in:
parent
57a0a69137
commit
35b1941a0b
3 changed files with 6 additions and 2 deletions
|
@ -85,7 +85,7 @@ export default function LayoutHead(props: Props): JSX.Element {
|
||||||
const {
|
const {
|
||||||
siteConfig: {
|
siteConfig: {
|
||||||
favicon,
|
favicon,
|
||||||
themeConfig: {metadatas},
|
themeConfig: {metadatas, image: defaultImage},
|
||||||
},
|
},
|
||||||
i18n: {currentLocale, localeConfigs},
|
i18n: {currentLocale, localeConfigs},
|
||||||
} = useDocusaurusContext();
|
} = useDocusaurusContext();
|
||||||
|
@ -105,6 +105,10 @@ export default function LayoutHead(props: Props): JSX.Element {
|
||||||
{favicon && <link rel="shortcut icon" href={faviconUrl} />}
|
{favicon && <link rel="shortcut icon" href={faviconUrl} />}
|
||||||
<title>{pageTitle}</title>
|
<title>{pageTitle}</title>
|
||||||
<meta property="og:title" content={pageTitle} />
|
<meta property="og:title" content={pageTitle} />
|
||||||
|
{image ||
|
||||||
|
(defaultImage && (
|
||||||
|
<meta name="twitter:card" content="summary_large_image" />
|
||||||
|
))}
|
||||||
</Head>
|
</Head>
|
||||||
|
|
||||||
<Seo {...{description, keywords, image}} />
|
<Seo {...{description, keywords, image}} />
|
||||||
|
|
|
@ -41,7 +41,6 @@ export default function Seo({
|
||||||
|
|
||||||
{pageImage && <meta property="og:image" content={pageImage} />}
|
{pageImage && <meta property="og:image" content={pageImage} />}
|
||||||
{pageImage && <meta name="twitter:image" content={pageImage} />}
|
{pageImage && <meta name="twitter:image" content={pageImage} />}
|
||||||
{pageImage && <meta name="twitter:card" content="summary_large_image" />}
|
|
||||||
</Head>
|
</Head>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -102,6 +102,7 @@ export type ThemeConfig = {
|
||||||
footer?: Footer;
|
footer?: Footer;
|
||||||
hideableSidebar: boolean;
|
hideableSidebar: boolean;
|
||||||
image: string;
|
image: string;
|
||||||
|
metadatas: Array<Record<string, string>>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export function useThemeConfig(): ThemeConfig {
|
export function useThemeConfig(): ThemeConfig {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue