mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-18 03:26:57 +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 {
|
||||
siteConfig: {
|
||||
favicon,
|
||||
themeConfig: {metadatas},
|
||||
themeConfig: {metadatas, image: defaultImage},
|
||||
},
|
||||
i18n: {currentLocale, localeConfigs},
|
||||
} = useDocusaurusContext();
|
||||
|
@ -105,6 +105,10 @@ export default function LayoutHead(props: Props): JSX.Element {
|
|||
{favicon && <link rel="shortcut icon" href={faviconUrl} />}
|
||||
<title>{pageTitle}</title>
|
||||
<meta property="og:title" content={pageTitle} />
|
||||
{image ||
|
||||
(defaultImage && (
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
))}
|
||||
</Head>
|
||||
|
||||
<Seo {...{description, keywords, image}} />
|
||||
|
|
|
@ -41,7 +41,6 @@ export default function Seo({
|
|||
|
||||
{pageImage && <meta property="og:image" content={pageImage} />}
|
||||
{pageImage && <meta name="twitter:image" content={pageImage} />}
|
||||
{pageImage && <meta name="twitter:card" content="summary_large_image" />}
|
||||
</Head>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -102,6 +102,7 @@ export type ThemeConfig = {
|
|||
footer?: Footer;
|
||||
hideableSidebar: boolean;
|
||||
image: string;
|
||||
metadatas: Array<Record<string, string>>;
|
||||
};
|
||||
|
||||
export function useThemeConfig(): ThemeConfig {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue