Closed armstrongl closed 10 months ago
βοΈ Deploy Preview for mcnuggies-dev-studio canceled.
π¨ Explore the source changes: 1911a1f29c480737f4cdd16b5b1eeef5c660eb35
π Inspect the deploy log: https://app.netlify.com/sites/mcnuggies-dev-studio/deploys/61f6f83f6e1f8a0008d7f03c
βοΈ Deploy Preview for mcnuggies-dev canceled.
π¨ Explore the source changes: 1911a1f29c480737f4cdd16b5b1eeef5c660eb35
π Inspect the deploy log: https://app.netlify.com/sites/mcnuggies-dev/deploys/61f6f84571678400076f27ab
This is an experiment to implement the site as a Next.js site instead of Gatsby.
Vercel has a tutorial on Migrating from Gatsby, which is useful but doesn't cover how to use Next.js with Sanity.io as a CMS. Luckily, Sanity has a tutorial on Making a blog with Next.js, React, and Sanity as well as an example project.
I decided not to migrate the existing
web
directory because it's going to get a little too messy but instead start from scratch, then move the important parts over.Here are the equivalents between our Gatsby setup and what our Next.js setup will look like:
gatsby-browser.js
:arrow_right: Next.js's__app.js
gatsby-image
:arrow_right:next/image
src/templates
:arrow_right:pges/blog/[slug].js
(this might be different with Sanity in the picture)Link
:arrow_right: Next.jsLink
(switchto
tohref
, and add an<a>
tag as a child of the element)gatsby-config.js
:arrow_right:config.js
react-helmet
:arrow_right:next/head