| 1 | import type { Metadata } from 'next' |
| 2 | import { env } |
| 3 | import { APP_DEFAULT_TITLE } |
| 4 | |
| 5 | export function createMetadata(override |
| 6 | return { |
| 7 | ...override, |
| 8 | alternates: { |
| 9 | canonical: '/', |
| 10 | ...override.alternates, |
| 11 | }, |
| 12 | robots: { |
| 13 | index: true, |
| 14 | follow: true, |
| 15 | ...(typeof override. |
| 16 | ? override.robots |
| 17 | : {}), |
| 18 | }, |
| 19 | icons: { |
| 20 | icon: '/icon.svg', |
| 21 | shortcut: '/icon.svg', |
| 22 | apple: '/icon.svg', |
| 23 | }, |
| 24 | openGraph: { |
| 25 | title: override.title |
| 26 | description: override.description |
| 27 | url: baseUrl.toString |
| 28 | images: '/opengraph-image.png', |
| 29 | siteName: APP_DEFAULT_TITLE, |
| 30 | ...override.openGraph, |
| 31 | }, |
| 32 | twitter: { |
| 33 | card: 'summary_large_image', |
| 34 | creator: '@gurpalsingh287', |
| 35 | title: override.title |
| 36 | description: override.description |
| 37 | images: '/twitter-image.png', |
| 38 | ...override.twitter, |
| 39 | }, |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | export const baseUrl = |
| 44 | env.NODE_ENV === |
| 45 | ? new URL( |
| 46 | : new URL( |