This commit is contained in:
@@ -23,6 +23,17 @@ export async function generateMetadata({
|
||||
try {
|
||||
const restaurant = await getRestaurant(name)
|
||||
const title = restaurant.seoTitle || restaurant.name
|
||||
const logo = restaurant.logo
|
||||
|
||||
let iconUrl = defaultIcon
|
||||
let icon192Url = defaultIcon
|
||||
let icon512Url = defaultIcon512
|
||||
|
||||
if (logo && logo.trim() !== "") {
|
||||
iconUrl = `/${name}/api/logo?url=${encodeURIComponent(logo)}&size=192`
|
||||
icon192Url = iconUrl
|
||||
icon512Url = `/${name}/api/logo?url=${encodeURIComponent(logo)}&size=512`
|
||||
}
|
||||
|
||||
return {
|
||||
title,
|
||||
@@ -30,12 +41,12 @@ export async function generateMetadata({
|
||||
manifest: `/${name}/manifest.webmanifest`,
|
||||
icons: {
|
||||
icon: [
|
||||
{ url: defaultIcon },
|
||||
{ url: defaultIcon, sizes: "192x192", type: "image/png" },
|
||||
{ url: defaultIcon512, sizes: "512x512", type: "image/png" },
|
||||
{ url: iconUrl },
|
||||
{ url: icon192Url, sizes: "192x192", type: "image/png" },
|
||||
{ url: icon512Url, sizes: "512x512", type: "image/png" },
|
||||
],
|
||||
shortcut: defaultIcon,
|
||||
apple: defaultIcon,
|
||||
shortcut: iconUrl,
|
||||
apple: iconUrl,
|
||||
},
|
||||
}
|
||||
} catch {
|
||||
|
||||
Reference in New Issue
Block a user