From 759d867c231c4156126cbf149fa1c4ab46056a1f Mon Sep 17 00:00:00 2001 From: Joshua Chen Date: Thu, 14 Apr 2022 09:16:48 +0800 Subject: [PATCH] rename helmet -> head --- packages/docusaurus-plugin-sitemap/src/createSitemap.ts | 4 ++-- packages/docusaurus-types/src/index.d.ts | 2 +- packages/docusaurus/src/commands/build.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/docusaurus-plugin-sitemap/src/createSitemap.ts b/packages/docusaurus-plugin-sitemap/src/createSitemap.ts index d26152f8e820c..fa4aefb75e529 100644 --- a/packages/docusaurus-plugin-sitemap/src/createSitemap.ts +++ b/packages/docusaurus-plugin-sitemap/src/createSitemap.ts @@ -16,7 +16,7 @@ import type {ReactElement} from 'react'; export default async function createSitemap( siteConfig: DocusaurusConfig, routesPaths: string[], - helmet: {[location: string]: HelmetServerState}, + head: {[location: string]: HelmetServerState}, options: PluginOptions, ): Promise { const {url: hostname} = siteConfig; @@ -34,7 +34,7 @@ export default async function createSitemap( return false; } // https://github.com/staylor/react-helmet-async/pull/167 - const meta = helmet[route]?.meta.toComponent() as unknown as + const meta = head[route]?.meta.toComponent() as unknown as | ReactElement[] | undefined; return !meta?.some( diff --git a/packages/docusaurus-types/src/index.d.ts b/packages/docusaurus-types/src/index.d.ts index 58d706bd4b2ea..189c5ef3ebebe 100644 --- a/packages/docusaurus-types/src/index.d.ts +++ b/packages/docusaurus-types/src/index.d.ts @@ -323,7 +323,7 @@ export type Plugin = { postBuild?: ( props: Props & { content: Content; - helmet: {[location: string]: HelmetServerState}; + head: {[location: string]: HelmetServerState}; }, ) => Promise | void; // TODO refactor the configureWebpack API surface: use an object instead of diff --git a/packages/docusaurus/src/commands/build.ts b/packages/docusaurus/src/commands/build.ts index 724f0bf9df4df..98f7d2bf85fc1 100644 --- a/packages/docusaurus/src/commands/build.ts +++ b/packages/docusaurus/src/commands/build.ts @@ -231,7 +231,7 @@ async function buildLocale({ } await plugin.postBuild({ ...props, - helmet: headTags, + head: headTags, content: plugin.content, }); }),