import Head from 'next/head' import styles from '../../styles/Post.module.scss' import HeaderNav from '../../lib/HeaderNav' import HeroImage from '../../lib/HeroImage' import { getPostSlugs, getPostBySlug } from '../../lib/posts' export async function getStaticPaths() { return { paths: (await getPostSlugs()).map((slug) => ({ params: { slug, } })), fallback: false, } } export async function getStaticProps({ params }) { return { props: { postData: await getPostBySlug(params.slug), } } } function generateCredit(postData) { if (!postData['hero credit']) return null; return { url: postData['hero credit'], text: postData['hero credit text'], } } export default function Post({ postData }) { return (