Visual Editing with Sanity

R
Renaudil y a 2 jours
0

Description

Sanity + Vercel Visual Editing demo, bringing intuitive content management to modern, composable content architectures.

npx boilerapp sanity-visual-editing-demo

文档

Vercel Visual Editing Demo<!-- omit in toc -->

Live demo

Note

Vercel Visual Editing is available on Vercel's Pro and Enterprise plans and on all Sanity plans.

This starter is preconfigured to support Visual Editing, a new feature that enables you to make changes using Vercel's draft mode and new edit functionality. It is a statically generated personal website that uses Next.js for the frontend and Sanity to handle its content.

It comes with a native Sanity Studio that offers features like real-time collaboration, instant side-by-side content previews, and intuitive editing.

The Studio connects to Sanity Content Lake, which gives you hosted content APIs with a flexible query language, on-demand image transformations, powerful patching, and more.

You can use this starter to kick-start a personal website to learn more about Visual Editing or other awesome Sanity features.

Deploy with Vercel

Features

  • A performant, static personal personal website with editable projects
  • A native and customizable authoring environment, accessible on yourpersonalwebsite.com/studio
  • Real-time and collaborative content editing with fine-grained revision history
  • Support for block content and the most advanced custom fields capability in the industry
  • Free Sanity project with unlimited admin users, free content updates, and pay-as-you-go for API overages
  • A project with starter-friendly and not too heavy-handed TypeScript and Tailwind.css

Table of Contents

Project Overview

Personal WebsiteStudio
Personal WebsiteSanity Studio

Important files and folders

File(s)Description
sanity.config.tsConfig file for Sanity Studio
sanity.cli.tsConfig file for Sanity CLI
/pages/studio/[[...index]]/page.tsxWhere Sanity Studio is mounted
/schemasWhere Sanity Studio gets its content types from
/pluginsWhere the advanced Sanity Studio customization is setup
/lib/sanity.api.ts,/lib/sanity.image.tsConfiguration for the Sanity Content Lake client

Configuration

Step 1. Set up the environment

Use the Deploy Button below. It will let you deploy the starter using Vercel as well as connect it to your Sanity Content Lake using the Sanity Vercel Integration.

Deploy with Vercel

Step 2. Set up the project locally

Clone the repository that was created for you on your GitHub account. Once cloned, run the following command from the project's root directory:

npx vercel link

Download the environment variables needed to connect Next.js and the Studio to your Sanity project:

npx vercel env pull

Step 3. Run Next.js locally in development mode

npm install && npm run dev

When you run this development server, the changes you make in your frontend and studio configuration will be applied live using hot reloading.

Your personal website should be up and running on http://localhost:3000! You can create and edit content on http://localhost:3000/studio.

Step 4. Deploy to production

To deploy your changes to production you use git:

git add .
git commit
git push

Alternatively, you can deploy without a git hosting provider using the Vercel CLI:

npx vercel --prod

Questions and Answers

How do I enable Visual Editing on my own Vercel project?

Read our guide.

It doesn't work! Where can I get help?

In case of any issues or questions, you can post:

How can I remove the "Next steps" block from my personal website?

You can remove it by deleting the IntroTemplate component in /components/shared/Layout.tsx and the /intro-template directory.

Next steps

Prix

Gratuit

FREE

评论 (0)

常见问题

常见问题解答 (FAQ)

有问题?我们有答案。如果您找不到想要的答案,请随时联络我们。

Boilerapp 是一个专门用于分享 Boilerplates、入门套件(Starter Kits)和项目模版的开发者社区平台。我们的目标很简单:为您节省初始配置(Setup)的时间,让您可以专注于真正重要的代码。无论您是在寻找简单的代码库还是完整的 SaaS 项目,都能在这里找到。

还有其他问题?

我们的团队随时为您提供帮助。联络我们,我们将尽快回复。

Visual Editing with Sanity | BoilerApp