🐛 fix(metadata): Global metadata
This commit is contained in:
parent
74cb16b1ae
commit
15d5ecfc80
@ -13,6 +13,7 @@ import NextTopLoader from 'nextjs-toploader';
|
||||
import React from 'react';
|
||||
|
||||
export async function generateMetadata(): Promise<Metadata> {
|
||||
try {
|
||||
const config = await getGlobalConfig({ skipErrorHandler: true }).then((res) => res.data.data!);
|
||||
const site = config.site || {};
|
||||
return {
|
||||
@ -32,6 +33,11 @@ export async function generateMetadata(): Promise<Metadata> {
|
||||
: [],
|
||||
},
|
||||
};
|
||||
} catch (error) {
|
||||
return {
|
||||
title: { default: 'PPanel', template: '%s | PPanel' },
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export default async function RootLayout({ children }: { children: React.ReactNode }) {
|
||||
|
||||
@ -13,8 +13,9 @@ import NextTopLoader from 'nextjs-toploader';
|
||||
import React from 'react';
|
||||
|
||||
export async function generateMetadata(): Promise<Metadata> {
|
||||
try {
|
||||
const config = await getGlobalConfig({ skipErrorHandler: true }).then((res) => res.data.data!);
|
||||
const site = config?.site || {};
|
||||
const site = config.site || {};
|
||||
return {
|
||||
title: {
|
||||
default: `${site.site_name}`,
|
||||
@ -32,6 +33,11 @@ export async function generateMetadata(): Promise<Metadata> {
|
||||
: [],
|
||||
},
|
||||
};
|
||||
} catch (error) {
|
||||
return {
|
||||
title: { default: 'PPanel', template: '%s | PPanel' },
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export default async function RootLayout({ children }: { children: React.ReactNode }) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user