tinloof / sanity-kit

83 stars 11 forks source link

Ability to lock folder to specific document types #75

Open danteissaias opened 5 months ago

danteissaias commented 5 months ago

Only allow blog posts to be created in /blog folder for example.

Jamiewarb commented 4 months ago

I believe this can already be achieved through a combination of initialValue for the pathname, and locking the folder, e.g.

definePathnameField({
  initialValue: { current: '/blog/' },
  options: { source: 'title', folder: { canUnlock: false } },
}),