From the course: Master Next.js: Elaborate Hands-On Web Development, React Basics, Advanced Next.js, and Deployment
Unlock this course with a free trial
Join today to access over 25,200 courses taught by industry experts.
Scripts and header data and props with Next.js
From the course: Master Next.js: Elaborate Hands-On Web Development, React Basics, Advanced Next.js, and Deployment
Scripts and header data and props with Next.js
All right, so enough looking at my cool self with pictures. Let's talk about metadata. What if we wanted to change the metadata of a page, like the title of an HTML tag? So title is part of the head HTML tag, but you have to think about this. So let's go back into the pages. We can leave my picture for now, let's go back into index. Let's find out that line with our header here. Now we have a header and then we put a title. Title is a part of this head tag, But notice how head is uppercase and title is lowercase. That's because head is a React component that's built in inherently to Next.js. And notice how that's imported here. So I don't think we've done that yet in our first post page. So let's go back to our first post and let's import the next head. So we're going to import head from next-head. and we're going to now let's update this first post which is an h1 to actually be a header so we're going to wrap it around the head voila now we've wrapped it around and instead of using…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
-
-
(Locked)
Download the CSS starter kit project from Next.js official7m 27s
-
(Locked)
How images optimize with Next.js5m 31s
-
(Locked)
Scripts and header data and props with Next.js6m 58s
-
(Locked)
CSS modules and Next.js optimizations with layout7m 12s
-
(Locked)
Global styling with Next.js4m 47s
-
(Locked)
Customizing utility styles with Next.js9m 55s
-
(Locked)
Metadata for SEO and social media with Next.js6m 43s
-
(Locked)
Writing dynamic layout components with Next.js11m 31s
-
(Locked)
How to use children and props in React and Next.js10m 54s
-
(Locked)
-
-
-