diff --git a/.changeset/forty-windows-punch.md b/.changeset/forty-windows-punch.md new file mode 100644 index 000000000..4ab81e58c --- /dev/null +++ b/.changeset/forty-windows-punch.md @@ -0,0 +1,5 @@ +--- +'@theguild/components': patch +--- + +adjust Next.js Metadata tags diff --git a/.changeset/seven-dolls-give.md b/.changeset/seven-dolls-give.md new file mode 100644 index 000000000..ba6dfa1e2 --- /dev/null +++ b/.changeset/seven-dolls-give.md @@ -0,0 +1,5 @@ +--- +'@theguild/components': patch +--- + +add `export { normalizePages } from 'nextra/normalize-pages'` diff --git a/packages/components/src/index.ts b/packages/components/src/index.ts index 379a64a06..51ad1c08d 100644 --- a/packages/components/src/index.ts +++ b/packages/components/src/index.ts @@ -20,6 +20,7 @@ export * from './types/components'; export * from './logos'; export { cn } from './cn'; export * from './next-types'; +export { normalizePages } from 'nextra/normalize-pages'; declare module 'react' { interface CSSProperties { diff --git a/packages/components/src/server/theme-layout.tsx b/packages/components/src/server/theme-layout.tsx index 28cae5881..73a7c8b93 100644 --- a/packages/components/src/server/theme-layout.tsx +++ b/packages/components/src/server/theme-layout.tsx @@ -183,12 +183,6 @@ export function getDefaultMetadata({ site: 'https://the-guild.dev', creator: '@TheGuildDev', }, - openGraph: { - siteName: websiteName, - type: 'website', - images: `https://og-image.the-guild.dev/?product=${productName}`, - url: siteUrl, - }, applicationName: websiteName, appleWebApp: { title: websiteName, @@ -198,8 +192,19 @@ export function getDefaultMetadata({ follow: true, }, alternates: { - canonical: siteUrl, + // https://github.com/vercel/next.js/discussions/50189#discussioncomment-10826632 + canonical: './', }, + metadataBase: new URL(siteUrl!), ...additionalMetadata, + openGraph: { + siteName: websiteName, + type: 'website', + images: `https://og-image.the-guild.dev/?product=${productName}`, + // https://github.com/vercel/next.js/discussions/50189#discussioncomment-10826632 + url: './', + locale: 'en_US', + ...additionalMetadata.openGraph, + }, }; } diff --git a/website/next-env.d.ts b/website/next-env.d.ts index 40c3d6809..1b3be0840 100644 --- a/website/next-env.d.ts +++ b/website/next-env.d.ts @@ -2,4 +2,4 @@ /// // NOTE: This file should not be edited -// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information. +// see https://nextjs.org/docs/app/api-reference/config/typescript for more information. diff --git a/website/next.config.ts b/website/next.config.ts index ed486962c..0740eb332 100644 --- a/website/next.config.ts +++ b/website/next.config.ts @@ -10,4 +10,7 @@ export default withGuildDocs({ // website:build: Error: Parsing error: Cannot read file '/users/dmytro/desktop/guild/docs/website/tsconfig.eslint.json'. ignoreDuringBuilds: true, }, + env: { + SITE_URL: 'https://guild-docs.example', + }, });