A Next.js starter for the JAMstack
This is a boilerplate for using Next.js as a static site generator.
To start your project, either:
- Deploy to Netlify using the button above, or
- Clone this repository and run:
npm install
This will take some time and will install all packages necessary to run the starter.
While developing your website, use:
npm start
Then visit http://localhost:3000/ to preview your new website. The Next.js development server will automatically reload the CSS or refresh the whole page, when stylesheets or content changes.
To build a static version of the website inside the /dist
folder, run:
npm run build
See package.json for all tasks.
You can read more about building sites and apps with Next.js in their documentation here:
A few resources for doing anything you can imagine with a 100% static site/app on the JAMstack using Next.js. If you would like to add more resources please open a pull request!
- Using Next.js as a Static Site Generator for Netlify - Shawn Wang
- Serverless Next.js 9 on Netlify Functions - Shawn Wang
The deploy to Netlify button above will create a new site and repo in one click. If you've created your repo manually, you can deploy to Netlify as follows:
- Push your clone to your own GitHub repository.
- Create a new site on Netlify and link the repository.
Now Netlify will build and deploy your site whenever you push to git.