diff --git a/src/frontend/next/src/components/SEO.tsx b/src/frontend/next/src/components/SEO.tsx new file mode 100644 index 0000000000..82fd04dad2 --- /dev/null +++ b/src/frontend/next/src/components/SEO.tsx @@ -0,0 +1,26 @@ +import Head from 'next/head'; +import { useRouter } from 'next/router'; +import config from '../config'; + +type SEOProps = { + pageTitle: string; +}; + +const SEO = ({ pageTitle }: SEOProps) => { + const { telescopeUrl } = config; + const { pathname } = useRouter(); + const currentUrl = `${telescopeUrl}${pathname}`; + + return ( + + + + + + ); +}; + +export default SEO; diff --git a/src/frontend/next/src/pages/_document.tsx b/src/frontend/next/src/pages/_document.tsx index 431ddd4348..fb50aac1f8 100644 --- a/src/frontend/next/src/pages/_document.tsx +++ b/src/frontend/next/src/pages/_document.tsx @@ -3,6 +3,8 @@ import Document, { Html, Head, Main, NextScript, DocumentContext } from 'next/do import { ServerStyleSheets } from '@material-ui/core/styles'; import { logoUrl } from '../components/Logo'; +import config from '../config'; +import lightTheme from '../theme/lightTheme'; // Reference: https://github.com/mui-org/material-ui/blob/master/examples/nextjs/pages/_document.js class MyDocument extends Document { @@ -12,10 +14,24 @@ class MyDocument extends Document { } render() { + const { title, description, author, telescopeUrl } = config; return ( + + + + + + + + + + + + +