Skip to content

πŸš€ Getting Started

1. New repoπŸ”—

Clone or fork the template from the GitHub repo.

2. Start a new Sanity projectπŸ”—

From the Sanity.io Manage dashboard, create a new project (blank schema) with CLI and retrieve a project id.

3. Update environment variablesπŸ”—

πŸ“ .env.local
NEXT_PUBLIC_BASE_URL = ... # https://sanitypress.dev
NEXT_PUBLIC_SANITY_PROJECT_ID = ... # abcdefgh
NEXT_PUBLIC_SANITY_DATASET = ... # production
NEXT_PUBLIC_SANITY_TOKEN = ... # "Viewer" token from https://sanity.io/manage

4. Populate the Sanity Studio with your contentπŸ”—

Open your new Sanity Studio (http://localhost:3000/admin) and publish the following required documents:

  1. a Site document with a title field.
  2. a Page document with slug: index to use as the Home page.

For websites with a blog, additionally publish the following documents:

  1. a Page document with slug: blog to use as the Blog listing page.
  2. a Page document with slug: blog/* to use as the Blog post template page.
    1. Make sure to add the Blog Post Content module to display the post's body content.

Optionally, you can publish the following documents:

  • a Page document with slug: 404 to use as the Page not found page.

Import a demo datasetπŸ”—

You can run a CLI command to import demo content to get SanityPress up and running in seconds.

sanity dataset import sanity/demo.tar.gz

This will import a Site document and a Page document with slug: index, the minimum requirements for SanityPress to deploy successfully.

5. Set up deploymentsπŸ”—

Install either of the following plugins to add a widget to your Studio Dashboard:

6. Customize the Next.js frontendπŸ”—

Adjust frontend styles (like animations or fonts), edit/add schema and modules, and more.

Helpful Articles

Read more on The SanityPress Blog