Skip to content

Commit

Permalink
adjust Next.js Metadata tags and add `export { normalizePages } from …
Browse files Browse the repository at this point in the history
…'nextra/normalize-pages'` (#1897)
  • Loading branch information
dimaMachina authored Dec 17, 2024
1 parent cfd9771 commit 5725a0b
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .changeset/forty-windows-punch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@theguild/components': patch
---

adjust Next.js Metadata tags
5 changes: 5 additions & 0 deletions .changeset/seven-dolls-give.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@theguild/components': patch
---

add `export { normalizePages } from 'nextra/normalize-pages'`
1 change: 1 addition & 0 deletions packages/components/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
19 changes: 12 additions & 7 deletions packages/components/src/server/theme-layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
},
};
}
2 changes: 1 addition & 1 deletion website/next-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
/// <reference types="next/image-types/global" />

// 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.
3 changes: 3 additions & 0 deletions website/next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
});

0 comments on commit 5725a0b

Please sign in to comment.