Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to import the Metadata type from Next.js.
NextJS
import type { [1] } from 'next';
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Head' which is a component, not a type.
Using 'Seo' or 'Meta' which are not valid imports.
✗ Incorrect
The Metadata type is imported from 'next' to define page metadata in Next.js.
2fill in blank
mediumComplete the code to export a metadata object with a title.
NextJS
export const metadata: Metadata = {
title: [1]
}; Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting quotes around the title string.
Using an undefined variable instead of a string.
✗ Incorrect
The title value must be a string literal, so it needs quotes.
3fill in blank
hardFix the error in the metadata description property.
NextJS
export const metadata: Metadata = {
description: [1]
}; Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Writing description without quotes causing syntax error.
Using a variable name instead of a string.
✗ Incorrect
The description must be a string literal, so it requires quotes.
4fill in blank
hardFill both blanks to add openGraph title and description in metadata.
NextJS
export const metadata: Metadata = {
openGraph: {
title: [1],
description: [2]
}
}; Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Missing quotes causing syntax errors.
Swapping title and description values.
✗ Incorrect
Both title and description must be string literals with quotes.
5fill in blank
hardFill all three blanks to add twitter card metadata with card type, title, and description.
NextJS
export const metadata: Metadata = {
twitter: {
card: [1],
title: [2],
description: [3]
}
}; Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using card type without quotes.
Mixing up title and description values.
✗ Incorrect
The twitter card type is usually 'summary_large_image' or 'summary'. Title and description must be strings.