Skip to content

Commit

Permalink
Move Head into CustomHead
Browse files Browse the repository at this point in the history
Moving the Head element into CustomHead fixes #819
  • Loading branch information
maddymakesgames committed Sep 10, 2024
1 parent 5e5eb8d commit b2684f0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
6 changes: 4 additions & 2 deletions src/components/layout/customHead.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Head from "next/head";
import { type LayoutProps } from "./layout";


Expand All @@ -21,7 +22,8 @@ export function CustomHead({


return (
<>
<Head>
<title>{pageTitle}</title>
<meta charSet="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />

Expand Down Expand Up @@ -67,6 +69,6 @@ export function CustomHead({
<meta name="twitter:description" content={pageDescription} />
<meta name="twitter:image" content={socialMediaImageUrl} />
<meta name="twitter:image:alt" content={socialMediaImageAlt} />
</>
</Head>
);
}
23 changes: 10 additions & 13 deletions src/components/layout/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Head from "next/head";
import { CustomHead } from "./customHead";
import { BackgroundImage, Grid, createStyles } from "@mantine/core";
import { BackgroundImage, Grid, Title, createStyles } from "@mantine/core";
import { Header } from "./header";
import { Navbar } from "./navbar/navbar";
import { Footer } from "./footer";
Expand Down Expand Up @@ -68,17 +67,15 @@ export const Layout = ({

return (
<>
<Head>
<CustomHead
pageTitle={pageTitle}
pageDescription={pageDescription}
pathname={pathname}
siteName={siteName}
robotsText={robotsText}
socialMediaImageUrl={socialMediaImageUrl}
socialMediaImageAlt={socialMediaImageAlt}
/>
</Head>
<CustomHead
pageTitle={pageTitle}
pageDescription={pageDescription}
pathname={pathname}
siteName={siteName}
robotsText={robotsText}
socialMediaImageUrl={socialMediaImageUrl}
socialMediaImageAlt={socialMediaImageAlt}
/>
<BackgroundImage
src="/images/cml_background1.png"
className={classes.backgroundImage}
Expand Down

0 comments on commit b2684f0

Please sign in to comment.