B2B-88: add starter kit structure and elements
This commit is contained in:
39
lib/root-metdata.ts
Normal file
39
lib/root-metdata.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import { Metadata } from 'next';
|
||||
|
||||
import { headers } from 'next/headers';
|
||||
|
||||
import appConfig from '~/config/app.config';
|
||||
|
||||
/**
|
||||
* @name generateRootMetadata
|
||||
* @description Generates the root metadata for the application
|
||||
*/
|
||||
export const generateRootMetadata = async (): Promise<Metadata> => {
|
||||
const headersStore = await headers();
|
||||
const csrfToken = headersStore.get('x-csrf-token') ?? '';
|
||||
|
||||
return {
|
||||
title: appConfig.title,
|
||||
description: appConfig.description,
|
||||
metadataBase: new URL(appConfig.url),
|
||||
applicationName: appConfig.name,
|
||||
other: {
|
||||
'csrf-token': csrfToken,
|
||||
},
|
||||
openGraph: {
|
||||
url: appConfig.url,
|
||||
siteName: appConfig.name,
|
||||
title: appConfig.title,
|
||||
description: appConfig.description,
|
||||
},
|
||||
twitter: {
|
||||
card: 'summary_large_image',
|
||||
title: appConfig.title,
|
||||
description: appConfig.description,
|
||||
},
|
||||
icons: {
|
||||
icon: '/images/favicon/favicon.ico',
|
||||
apple: '/images/favicon/apple-touch-icon.png',
|
||||
},
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user