@@ -3,10 +3,10 @@ import "@/once-ui/tokens/index.scss";
33
44import classNames from "classnames" ;
55import { headers } from "next/headers" ;
6- import { Metadata } from "next" ;
76
8- import { baseURL , style , meta , og , schema , social } from "@/app/resources/config" ;
9- import { Background , Column , Flex , ToastProvider , ThemeProvider } from "@/once-ui/components" ;
7+ import { baseURL , meta , og , schema , style } from "@/app/resources/config" ;
8+ import { Background , Column , Flex , ThemeProvider , ToastProvider } from "@/once-ui/components" ;
9+ import { Meta , Schema } from "@/once-ui/modules" ;
1010
1111import { Geist } from "next/font/google" ;
1212import { Geist_Mono } from "next/font/google" ;
@@ -36,58 +36,16 @@ const tertiary: FontConfig | undefined = undefined;
3636/*
3737 */
3838
39- export async function generateMetadata ( ) : Promise < Metadata > {
40- const host = ( await headers ( ) ) . get ( "host" ) ;
41- const metadataBase = host ? new URL ( `https://${ host } ` ) : undefined ;
42-
43- return {
39+ export async function generateMetadata ( ) {
40+ return Meta . generate ( {
4441 title : meta . title ,
4542 description : meta . description ,
46- openGraph : {
47- title : og . title ,
48- description : og . description ,
49- url : "https://" + baseURL ,
50- images : [
51- {
52- url : og . image ,
53- alt : og . title ,
54- } ,
55- ] ,
56- type : og . type as
57- | "website"
58- | "article"
59- | "book"
60- | "profile"
61- | "music.song"
62- | "music.album"
63- | "music.playlist"
64- | "music.radio_station"
65- | "video.movie"
66- | "video.episode"
67- | "video.tv_show"
68- | "video.other" ,
69- } ,
70- twitter : {
71- card : "summary_large_image" ,
72- title : og . title ,
73- description : og . description ,
74- images : [ og . image ] ,
75- } ,
76- metadataBase,
77- } ;
43+ baseURL,
44+ path : "/" ,
45+ image : og . image
46+ } ) ;
7847}
7948
80- const schemaData = {
81- "@context" : "https://schema.org" ,
82- "@type" : schema . type ,
83- url : "https://" + baseURL ,
84- logo : schema . logo ,
85- name : schema . name ,
86- description : schema . description ,
87- email : schema . email ,
88- sameAs : Object . values ( social ) . filter ( Boolean ) ,
89- } ;
90-
9149export default function RootLayout ( {
9250 children,
9351} : Readonly < {
@@ -116,13 +74,15 @@ export default function RootLayout({
11674 tertiary ? tertiary . variable : "" ,
11775 ) }
11876 >
77+ < Schema
78+ as = "organization"
79+ title = { schema . name }
80+ description = { schema . description }
81+ baseURL = { baseURL }
82+ path = "/"
83+ image = { schema . logo }
84+ />
11985 < head >
120- < script
121- type = "application/ld+json"
122- dangerouslySetInnerHTML = { {
123- __html : JSON . stringify ( schemaData ) ,
124- } }
125- />
12686 < script
12787 dangerouslySetInnerHTML = { {
12888 __html : `
0 commit comments