<head>
element of our document. Tags such as title
and description
can be important for SEO so it's good practice if our theme includes them.<Head>
component that can be used to add tags to the HTML <head>
element.<Head>
component into our root component file. Then anything that we include within <Head>...</Head>
tags in our component will be included in the <head>
section of the HTML document sent to the browser.<Head>
component wherever you like, there’s no need for it to be in the <Root>
component of the theme. Additionally you can use variables so that the tags change dynamically according to the content.<title>
element and the post excerpt in the meta description
tag on post pages. As before, we'll import the <Head>
component into post.js
and use it within the returned element. But instead of the strings that we used before we'll populate the content of the elements with data from the post.page.js
and then test the results using the About Us
page.