Template for blog / marketing site built next.js & sanity.io
This starter template built upon Next.js 13 with the new app directory & router. Sanity is used for content handling, and Tailwind is used for styling.
Import the project in vercel Setup following environment variables (as plain text variables)
NEXT_PUBLIC_SANITY_PROJECT_ID
with value for your prefered dataset
NEXT_PUBLIC_SANITY_DATASET
with your sanity project id
Create .env
file in root path with the environment variables
# For Next Locally
NEXT_PUBLIC_SANITY_PROJECT_ID = "abcd1245"
NEXT_PUBLIC_SANITY_DATASET = "production"
To Start development server:
npm run dev
This will run frontend at localhost:3000 and you will find sanity studio at localhost:3000/studio
Add http://localhost:3000 in sanity settings -> api - CORS Origins
- Frontend startpage is fetched with slug
frontpage
- Posts list is fetched with the slug
posts