Questions tagged [sanity]

Sanity is a structured content platform and API that also offers an open source, React-based Studio that functions as like a headless CMS on top of the Sanity APIs.

Sanity treats content as structured data and makes it easily available over an API. The collaborative editor, called the Content Studio, is a fully customizable, client-side web application. Documentation here.

833 questions
0
votes
1 answer

Sanity slug validate chars are lowercase

I am building a vue website using sanity as a backend. Instead of rewriting URLS in the router I want to have a pattern in place in sanity where slugs must only be lowercase letters so, this-is-a-slug-123 would be valid but THIS-is-A-slug-123 would…
Udders
  • 6,914
  • 24
  • 102
  • 194
0
votes
1 answer

How do I wrap a link around an image in sanity.io cms?

I want to be able to place an image inside a post within Sanity.io CMS and add an anchor tag around that image. This way when the user clicks on the image it will take them to a different page. Whenever I click on the image, the link feature in the…
bsmith
  • 103
  • 3
  • 10
0
votes
1 answer

Displaying Images in NextJs without horizontal white space

I'm presenting images using tag in NextJs application. I would like to display the images responsively, without causing whitespace horizontally. See this image for example You can see that there is a lot of whitespace as I'm hardcoding height and…
Sachin Titus
  • 1,960
  • 3
  • 23
  • 41
0
votes
1 answer

Accidently deleted sanity studio from pc, How can I get my schema back?

My noob ass removed Sanity Studio from my pc ( didn't initialize it as git repo). Now is there any way to get the studio back to the pc for local development from the deployed studio? I deployed the studio but don't have a local copy. I just need…
0
votes
1 answer

Is sanity studio needed in your project?

I am trying to setup sanity in a Svelte & Routify project. was wondering if having an entire thing for sanity is necessary, I know you can publish the studio to .sanity.io, wondering why isn't everything online in the first place and not somethings…
GHOST
  • 94
  • 3
0
votes
1 answer

Sanity Serializers in Eleventy (11ty)

I've implemented Sanity CMS into Eleventy, and have a working 11ty filter that converts Portable Text to HTML. I have a fair number of custom blocks, and therefore I'm also passing serializers. However, I am incapable of making one of those…
batz
  • 3
  • 1
0
votes
2 answers

zsh: command not found: sanity

Hi I have installed the Sanity CLI using: npm install -g @sanity/cli However when I try sanity init, I get: zsh: command not found: sanity it does work when I use: npx @sanity/cli init However when I try to use sanity start I get the command not…
Gmcintosh
  • 41
  • 7
0
votes
1 answer

Netlify Deploy Command failed with exit code 254: npm run build-studio && cp studio/netlify.toml studio/dist

Please help! I’m a newb! Trying to deploy my first site on Netlify, using Sanity’s Gatsby portfolio template. It deployed just fine the first time, then I did some edits and now it fails with “Command failed with exit code 254: npm run build-studio…
Eric Rodgers
  • 11
  • 1
  • 3
0
votes
1 answer

sanity upgrade ERROR: Couldn't find package "@babel/plugin-proposal-class-properties@^7.10.4" required by "@sanity/core@^2.18.0"

I'm using fedora Linux when I used sanity upgrade command in my studio folder i had this error : ✖ Resolving dependencies ✖ Couldn't find package "@babel/plugin-proposal-class-properties@^7.10.4" required by "@sanity/core@^2.18.0" on the "npm"…
Pedram Siavashi
  • 135
  • 1
  • 7
0
votes
1 answer

make the query dynamically to change using sanity.io groq

Hi there I'm trying to make a post request where I want to update one field on sanity.io this is my query patch: { id: "f6c46b53-9313-4354-a4d6-7a40b06ee4c0", set: { `rewardItem[_key == \"${key}\"].lastTimeReward`:…
0
votes
1 answer

Sanity in React: How can I fetch many students related to one project??? (Many authors to 1 Block)

I am working on a portfolio website in React using Sanity. The two components objects are students and projects. On the homepage, I can click on a link to a specific project, and this routes to another page showing the individual project.…
Ben Fisher
  • 59
  • 5
0
votes
1 answer

Gatsby watchMode and overlayDrafts not working on S3 static website

I have a project with Gatsby that its 'build' is deployed to AWS S3 bucket with static website hosting. My Gatsby project is using gatsby-source-sanity plugin, that is getting data from Sanity.io dataset. On my non production stages I would like to…
ROKIKOKI
  • 571
  • 2
  • 9
  • 24
0
votes
0 answers

Sanity/React Blog Failed to compile message

I'm following the step by step instructions at https://www.sanity.io/guides/build-your-first-blog-using-react#c46733c34d93 I'm getting the following error. Failed to compile. ./src/App.js Module not found: Can't resolve './components/AllPosts.js'…
ABlair
  • 1
  • 2
0
votes
1 answer

2 arrays/objects with same values but one has more objects - how to simplify code without repeating?

I am having the following issue. I have created 2 arrays named: editorDesk and adminDesk the only difference is actually, that the adminDesk has menu items => Routes, Navigation, and Friends. The problem is I am having duplicate code to make this…
user10431099
0
votes
1 answer

Looping through array within Sanity Io React

I'm using react with sanity io to create a portfolio page. I would like to create an unordered list according to how many tags I have a on a project. A project is composed of a title, image, description, and tags(this is just an array). What I have…
wayoh22
  • 176
  • 9