0
0
PPsypher1
NextSeo allows you to append metadata to your routes, which then runs through Meta() to generate the appropriate HTML.
In this example, we are adding a title and description to the HTML for our route. We are also adding some meta information about our website, like the title and description for our Open Graph tags. We are also setting the open graph property for our route.
Library: next
import { NextSeo } from "next-seo";
import { useRouter } from "next/router";
import { NextSeo } from "next-seo";
import { useRouter } from "next/router";
export default function Meta({ pageMeta }) {
const router = useRouter();
const meta = {
title: "The Language Hub",
description: "Getting you to what's important as easily as possible",
// canonical: `http://localhost:3000${router.asPath}`,
...pageMeta,
};
const SEO = {
title: `TLH | ${meta.title}`,
description: meta.description,
openGraph: {
title: meta.title,
description: meta.description,
},
};
return <NextSeo {...SEO} />;
}