import NextHead from 'next/head'; import siteConfig from '../content/site.json'; import { RoadmapType } from '../lib/roadmap'; import { roadmapTheme } from '../styles/theme'; type HelmetProps = { title?: string; keywords?: string[]; canonical?: string; description?: string; roadmap?: RoadmapType; }; function getRichSnippetJson(roadmap: RoadmapType) { return { '@context': 'https://schema.org', '@type': 'Article', mainEntityOfPage: { '@type': 'WebPage', '@id': `https://roadmap.sh/${roadmap.id}`, }, headline: roadmap.seo.title, description: roadmap.seo.description, image: roadmap.jsonUrl ? `https://roadmap.sh/roadmaps/${roadmap.id}.png` : undefined, author: { '@type': 'Person', name: 'Kamran Ahmed', url: 'https://twitter.com/kamranahmedse', }, publisher: { '@type': 'Organization', name: 'roadmap.sh', logo: { '@type': 'ImageObject', url: 'https://roadmap.sh/brand-square.png', }, }, }; } const Helmet = (props: HelmetProps) => { const { roadmap, title, canonical, description, keywords } = props; return ( {title || siteConfig.title} {canonical && } {roadmap?.id && ( )} {/* Global Site Tag (gtag.js) - Google Analytics */} {process.env.GA_SECRET && ( <>