Skip to content

Commit 5725a0b

Browse files
authoredDec 17, 2024··
adjust Next.js Metadata tags and add export { normalizePages } from 'nextra/normalize-pages' (#1897)
1 parent cfd9771 commit 5725a0b

File tree

6 files changed

+27
-8
lines changed

6 files changed

+27
-8
lines changed
 

‎.changeset/forty-windows-punch.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@theguild/components': patch
3+
---
4+
5+
adjust Next.js Metadata tags

‎.changeset/seven-dolls-give.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@theguild/components': patch
3+
---
4+
5+
add `export { normalizePages } from 'nextra/normalize-pages'`

‎packages/components/src/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export * from './types/components';
2020
export * from './logos';
2121
export { cn } from './cn';
2222
export * from './next-types';
23+
export { normalizePages } from 'nextra/normalize-pages';
2324

2425
declare module 'react' {
2526
interface CSSProperties {

‎packages/components/src/server/theme-layout.tsx

+12-7
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,6 @@ export function getDefaultMetadata({
183183
site: 'https://the-guild.dev',
184184
creator: '@TheGuildDev',
185185
},
186-
openGraph: {
187-
siteName: websiteName,
188-
type: 'website',
189-
images: `https://og-image.the-guild.dev/?product=${productName}`,
190-
url: siteUrl,
191-
},
192186
applicationName: websiteName,
193187
appleWebApp: {
194188
title: websiteName,
@@ -198,8 +192,19 @@ export function getDefaultMetadata({
198192
follow: true,
199193
},
200194
alternates: {
201-
canonical: siteUrl,
195+
// https://github.com/vercel/next.js/discussions/50189#discussioncomment-10826632
196+
canonical: './',
202197
},
198+
metadataBase: new URL(siteUrl!),
203199
...additionalMetadata,
200+
openGraph: {
201+
siteName: websiteName,
202+
type: 'website',
203+
images: `https://og-image.the-guild.dev/?product=${productName}`,
204+
// https://github.com/vercel/next.js/discussions/50189#discussioncomment-10826632
205+
url: './',
206+
locale: 'en_US',
207+
...additionalMetadata.openGraph,
208+
},
204209
};
205210
}

‎website/next-env.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
/// <reference types="next/image-types/global" />
33

44
// NOTE: This file should not be edited
5-
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.
5+
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

‎website/next.config.ts

+3
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,7 @@ export default withGuildDocs({
1010
// website:build: Error: Parsing error: Cannot read file '/users/dmytro/desktop/guild/docs/website/tsconfig.eslint.json'.
1111
ignoreDuringBuilds: true,
1212
},
13+
env: {
14+
SITE_URL: 'https://guild-docs.example',
15+
},
1316
});

0 commit comments

Comments
 (0)
Please sign in to comment.