Complete the code to define metadata in a Next.js layout.
export const metadata = { title: '[1]' };
export default function RootLayout({ children }) {
return <html><body>{children}</body></html>;
}children as the title value.The metadata object defines the page title for the layout.
Complete the code to add a description to the metadata object.
export const metadata = {
title: 'Home',
description: '[1]'
};The description property provides a short summary for the page metadata.
Fix the error in the metadata export syntax.
export const metadata[1] { title: 'About' };
The correct syntax to export a constant object is export const metadata = { ... }.
Fill both blanks to add open graph metadata for title and description.
export const metadata = {
openGraph: {
title: '[1]',
description: '[2]'
}
};Open Graph metadata helps social media show rich previews with title and description.
Fill all three blanks to define metadata with title, twitter card type, and robots directive.
export const metadata = {
title: '[1]',
twitter: {
card: '[2]'
},
robots: {
index: [3]
}
};This metadata sets the page title, Twitter card type for rich preview, and allows search engines to index the page.
