diff --git a/build.washingtonpost.com/components/next-seo/defaultSeo.tsx b/build.washingtonpost.com/components/next-seo/defaultSeo.tsx new file mode 100644 index 000000000..11c1de5c9 --- /dev/null +++ b/build.washingtonpost.com/components/next-seo/defaultSeo.tsx @@ -0,0 +1,60 @@ +import React from "react"; +import Head from "next/head"; + +interface SeoConfig { + defaultTitle: string; + description: string; + openGraph: { + type: string; + locale: string; + url: string; + site_name: string; + title: string; + images: // array of images + { + url: string; + width: number; + height: number; + alt: string; + }[]; + }; + twitter: { + handle: string; + site: string; + cardType: string; + url: string; + title: string; + description: string; + }; +} + +interface DefaultSeoProps { + seoConfig: SeoConfig; +} + +export const DefaultSeo: React.FC = ({ seoConfig }) => { + return ( + + {seoConfig.defaultTitle} + + + + + + + {seoConfig.openGraph.images.map((image, index) => ( + + ))} + + + + + + + + + ); +}; diff --git a/build.washingtonpost.com/components/next-seo/index.tsx b/build.washingtonpost.com/components/next-seo/index.tsx new file mode 100644 index 000000000..adbae5866 --- /dev/null +++ b/build.washingtonpost.com/components/next-seo/index.tsx @@ -0,0 +1,2 @@ +export { DefaultSeo } from "./defaultSeo"; +export { NextSeo } from "./nextSeo"; diff --git a/build.washingtonpost.com/components/next-seo/nextSeo.tsx b/build.washingtonpost.com/components/next-seo/nextSeo.tsx new file mode 100644 index 000000000..5ff8d90f6 --- /dev/null +++ b/build.washingtonpost.com/components/next-seo/nextSeo.tsx @@ -0,0 +1,16 @@ +import React from "react"; +import Head from "next/head"; + +interface pageSeoConfig { + title: string; + description: string; +} + +export const NextSeo: React.FC = ({ title, description }) => { + return ( + + {title} + + + ); +}; diff --git a/build.washingtonpost.com/package.json b/build.washingtonpost.com/package.json index d9992bb56..b2b6b141b 100644 --- a/build.washingtonpost.com/package.json +++ b/build.washingtonpost.com/package.json @@ -34,7 +34,6 @@ "lz-string": "^1.4.4", "next": "^14", "next-mdx-remote": "^4.4.1", - "next-seo": "5.15.0", "next-themes": "0.2.1", "param-case": "^3.0.4", "pascal-case": "^3.1.2", diff --git a/build.washingtonpost.com/pages/_app.js b/build.washingtonpost.com/pages/_app.js index 034564bbd..827d0e870 100644 --- a/build.washingtonpost.com/pages/_app.js +++ b/build.washingtonpost.com/pages/_app.js @@ -3,7 +3,7 @@ import React from "react"; import { ThemeProvider } from "next-themes"; import Script from "next/script"; -import { DefaultSeo } from "next-seo"; +import { DefaultSeo } from "../components/next-seo"; import "react-toastify/dist/ReactToastify.css"; import { globalStyles, @@ -87,7 +87,7 @@ function App({ Component, pageProps }) { return ( <> - + { - const css = getCssText(); - reset(); - return css; -}; +export default function Document() { + return ( + + + +