import Head from 'next/head'; import { useRouter } from 'next/router'; import { SITE_NAME, SITE_URL } from '../../constants'; interface Props { title: string; description: string; image?: string; } export const PageMetadata: React.FC = ({ title, description, image }) => { const router = useRouter(); const url = `${SITE_URL}${router.asPath}`; const fullTitle = `${title} | ${SITE_NAME}`; const defaultOgImage = `${SITE_URL}/images/metadata-gopher.png`; const ogImage = !image ? defaultOgImage : `${SITE_URL}${image}`; return ( {fullTitle} {/* OpenGraph */} {/* Twitter */} {/* patch to force a cache invalidation of twitter's card bot */} ); };