There are several options for hosting your Gatsby blog. In this lesson, you'll learn how to deploy your site to Netlify.
It's possible to keep the code on GitHub and gatsby build
from Netlify, which I think is a better choice for a personal blog.
This is a great course and I will definitely continue to use Gatsby. In the hopes of helping anyone else who ran into the same problem I did, I would also like to share a comment on the last video for deploying to Netlify. I needed to run gatsby clean
first then gatsby build
as it was still deploying the develop version which does not work as a standalone app.
I tried installing last episode and running it to see what it builds and turns out it gives me an error saying we are using hooks outside of funcitonal component and doesnt allows me to see it
I am getting an error that says hooks shouldnt be used outside of functional components
@Mortimer, I got the same error before. Doing an rm -rf node_modules/ && rm package-lock.json
then npm install
helped for me
Yes. It's also possible to deploy the entire Gatsby website to Netlify. Click on the Deploy site
button and Netlify will start the build
and deploy
process you have specified. You can go to the Deploys tab
and see the process unfold in the Deploy log
. After a few moments, it will give you the live site URL, e.g., random-name.netlify.com
.
Remember to add your deploy settings with the below options:
master
.npm run build
. public
.