This commit is contained in:
@@ -2,8 +2,6 @@ node_modules
|
|||||||
dist
|
dist
|
||||||
.astro
|
.astro
|
||||||
public/admin
|
public/admin
|
||||||
.env
|
|
||||||
.env.*
|
|
||||||
.git
|
.git
|
||||||
.gitignore
|
.gitignore
|
||||||
*.md
|
*.md
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
# Build: generates /dist (Astro static site + Sanity Studio SPA)
|
# Build: generates /dist (Astro static site + Sanity Studio SPA)
|
||||||
FROM node:24 AS builder
|
FROM node:22-alpine AS builder
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
RUN npm ci
|
RUN npm ci
|
||||||
|
|||||||
@@ -6,6 +6,24 @@ import { schemaTypes } from './src/sanity/schemas'
|
|||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
projectId: import.meta.env.PUBLIC_SANITY_PROJECT_ID,
|
projectId: import.meta.env.PUBLIC_SANITY_PROJECT_ID,
|
||||||
dataset: import.meta.env.PUBLIC_SANITY_DATASET ?? 'production',
|
dataset: import.meta.env.PUBLIC_SANITY_DATASET ?? 'production',
|
||||||
|
document: {
|
||||||
|
// Filter document actions
|
||||||
|
actions: (prev, context) => {
|
||||||
|
// For singleton documents like site settings
|
||||||
|
if (context.schemaType === 'theaterHomepage') {
|
||||||
|
// Only allow publish action (equivalent to ["update", "publish"])
|
||||||
|
return prev.filter(({action}) => action === 'publish')
|
||||||
|
}
|
||||||
|
return prev
|
||||||
|
},
|
||||||
|
|
||||||
|
// Prevent creating new documents of this type
|
||||||
|
newDocumentOptions: (prev, context) => {
|
||||||
|
return prev.filter(
|
||||||
|
(template) => template.templateId !== 'siteSettings'
|
||||||
|
)
|
||||||
|
}
|
||||||
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
structureTool({
|
structureTool({
|
||||||
structure: (S) =>
|
structure: (S) =>
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ export const theaterHomepageSchema = defineType({
|
|||||||
title: 'Theater Homepage',
|
title: 'Theater Homepage',
|
||||||
type: 'document',
|
type: 'document',
|
||||||
// Singleton: disable create/delete — only update and publish
|
// Singleton: disable create/delete — only update and publish
|
||||||
__experimental_actions: ['update', 'publish'],
|
|
||||||
fields: [
|
fields: [
|
||||||
defineField({
|
defineField({
|
||||||
name: 'title',
|
name: 'title',
|
||||||
|
|||||||
Reference in New Issue
Block a user