-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pnpm create sanity@latest -- --template clean --create-project "mueller" --dataset production
- Loading branch information
Showing
13 changed files
with
8,374 additions
and
1,302 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,15 @@ | ||
import type { NextConfig } from "next"; | ||
import type {NextConfig} from 'next' | ||
|
||
const nextConfig: NextConfig = { | ||
/* config options here */ | ||
}; | ||
images: { | ||
remotePatterns: [ | ||
{ | ||
protocol: 'https', | ||
hostname: 'cdn.sanity.io', | ||
}, | ||
], | ||
}, | ||
// ...other config settings | ||
} | ||
|
||
export default nextConfig; | ||
export default nextConfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/** | ||
* This configuration file lets you run `$ sanity [command]` in this folder | ||
* Go to https://www.sanity.io/docs/cli to learn more. | ||
**/ | ||
import { defineCliConfig } from 'sanity/cli' | ||
|
||
const projectId = process.env.NEXT_PUBLIC_SANITY_PROJECT_ID | ||
const dataset = process.env.NEXT_PUBLIC_SANITY_DATASET | ||
|
||
export default defineCliConfig({ api: { projectId, dataset } }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
'use client' | ||
|
||
/** | ||
* This configuration is used to for the Sanity Studio that’s mounted on the `\src\app\studio\[[...tool]]\page.tsx` route | ||
*/ | ||
|
||
import {visionTool} from '@sanity/vision' | ||
import {defineConfig} from 'sanity' | ||
import {structureTool} from 'sanity/structure' | ||
|
||
// Go to https://www.sanity.io/docs/api-versioning to learn how API versioning works | ||
import {apiVersion, dataset, projectId} from './src/sanity/env' | ||
import {schema} from './src/sanity/schemaTypes' | ||
import {structure} from './src/sanity/structure' | ||
|
||
export default defineConfig({ | ||
basePath: '/studio', | ||
projectId, | ||
dataset, | ||
// Add and edit the content schema in the './sanity/schemaTypes' folder | ||
schema, | ||
plugins: [ | ||
structureTool({structure}), | ||
// Vision is for querying with GROQ from inside the Studio | ||
// https://www.sanity.io/docs/the-vision-plugin | ||
visionTool({defaultApiVersion: apiVersion}), | ||
], | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; | ||
|
||
#sanity { | ||
position: relative; | ||
z-index: 9999; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/** | ||
* This route is responsible for the built-in authoring environment using Sanity Studio. | ||
* All routes under your studio path is handled by this file using Next.js' catch-all routes: | ||
* https://nextjs.org/docs/routing/dynamic-routes#catch-all-routes | ||
* | ||
* You can learn more about the next-sanity package here: | ||
* https://github.com/sanity-io/next-sanity | ||
*/ | ||
|
||
import { NextStudio } from 'next-sanity/studio' | ||
import config from '../../../../sanity.config' | ||
|
||
export const dynamic = 'force-static' | ||
|
||
export { metadata, viewport } from 'next-sanity/studio' | ||
|
||
export default function StudioPage() { | ||
return <NextStudio config={config} /> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
export const apiVersion = | ||
process.env.NEXT_PUBLIC_SANITY_API_VERSION || '2024-11-17' | ||
|
||
export const dataset = assertValue( | ||
process.env.NEXT_PUBLIC_SANITY_DATASET, | ||
'Missing environment variable: NEXT_PUBLIC_SANITY_DATASET' | ||
) | ||
|
||
export const projectId = assertValue( | ||
process.env.NEXT_PUBLIC_SANITY_PROJECT_ID, | ||
'Missing environment variable: NEXT_PUBLIC_SANITY_PROJECT_ID' | ||
) | ||
|
||
function assertValue<T>(v: T | undefined, errorMessage: string): T { | ||
if (v === undefined) { | ||
throw new Error(errorMessage) | ||
} | ||
|
||
return v | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { createClient } from 'next-sanity' | ||
|
||
import { apiVersion, dataset, projectId } from '../env' | ||
|
||
export const client = createClient({ | ||
projectId, | ||
dataset, | ||
apiVersion, | ||
useCdn: true, // Set to false if statically generating pages, using ISR or tag-based revalidation | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import createImageUrlBuilder from '@sanity/image-url' | ||
import { SanityImageSource } from "@sanity/image-url/lib/types/types"; | ||
|
||
import { dataset, projectId } from '../env' | ||
|
||
// https://www.sanity.io/docs/image-url | ||
const builder = createImageUrlBuilder({ projectId, dataset }) | ||
|
||
export const urlFor = (source: SanityImageSource) => { | ||
return builder.image(source) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Querying with "sanityFetch" will keep content automatically updated | ||
// Before using it, import and render "<SanityLive />" in your layout, see | ||
// https://github.com/sanity-io/next-sanity#live-content-api for more information. | ||
import { defineLive } from "next-sanity"; | ||
import { client } from './client' | ||
|
||
export const { sanityFetch, SanityLive } = defineLive({ | ||
client: client.withConfig({ | ||
// Live content is currently only available on the experimental API | ||
// https://www.sanity.io/docs/api-versioning | ||
apiVersion: 'vX' | ||
}) | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { type SchemaTypeDefinition } from 'sanity' | ||
|
||
export const schema: { types: SchemaTypeDefinition[] } = { | ||
types: [], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import type {StructureResolver} from 'sanity/structure' | ||
|
||
// https://www.sanity.io/docs/structure-builder-cheat-sheet | ||
export const structure: StructureResolver = (S) => | ||
S.list() | ||
.title('Content') | ||
.items(S.documentTypeListItems()) |