Skip to content

Commit 05b413b

Browse files
committed
♻️ Deduplicate meta Description Tags Across Pages
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
1 parent c026b53 commit 05b413b

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

interface/src/components/layout/Head.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
import NextHead from "next/head";
2+
import { generateNextSeo } from "next-seo/pages";
23
import { SITE_DESCRIPTION, SITE_NAME } from "@/lib/constants";
34

45
interface Props {
56
title?: string;
67
description?: string;
78
}
89

9-
export const Head = (props: Props) => {
10+
export const Head = ({ title, description }: Props) => {
11+
const seoProps = {
12+
title: title ? `${title} | ${SITE_NAME}` : SITE_NAME,
13+
description: description ?? SITE_DESCRIPTION,
14+
};
15+
1016
return (
1117
<NextHead>
12-
<title>{props.title ? `${props.title} | ${SITE_NAME}` : SITE_NAME}</title>
13-
<meta
14-
name="description"
15-
content={props.description ?? SITE_DESCRIPTION}
16-
/>
18+
{generateNextSeo(seoProps)}
1719
<meta name="viewport" content="width=device-width, initial-scale=1" />
1820
</NextHead>
1921
);

0 commit comments

Comments
 (0)