export async function getStaticProps(context) {
  // default empty slug so that it doesn't return "undefined"
  const {slug = ''} = context.params
  const post = await client.fetch(query, {slug})
  return {
    props: {
      post,
    },
  }