| 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: override.alternates |
| 9 | robots: { |
| 10 | index: true, |
| 11 | follow: true, |
| 12 | ...(typeof override. |
| 13 | ? override.robots |
| 14 | : {}), |
| 15 | }, |
| 16 | icons: { |
| 17 | icon: '/icon.svg', |
| 18 | shortcut: '/icon.svg', |
| 19 | apple: '/icon.svg', |
| 20 | }, |
| 21 | openGraph: { |
| 22 | title: override.title |
| 23 | description: override.description |
| 24 | url: baseUrl.toString |
| 25 | images: '/opengraph-image.png', |
| 26 | siteName: APP_DEFAULT_TITLE, |
| 27 | ...override.openGraph, |
| 28 | }, |
| 29 | twitter: { |
| 30 | card: 'summary_large_image', |
| 31 | creator: '@gurpalsingh287', |
| 32 | title: override.title |
| 33 | description: override.description |
| 34 | images: '/twitter-image.png', |
| 35 | ...override.twitter, |
| 36 | }, |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | export const baseUrl = |
| 41 | env.NODE_ENV === |
| 42 | ? new URL( |
| 43 | : new URL( |