✨Discover storytelling in the AI age with Pixar's Matthew Luhn at Sanity Connect, May 8th—register now

Issue with content publishing in Sanity + Eleventy + Netlify setup

7 replies
Last updated: Apr 12, 2021
Hello!! I am stuck with the content publishing for the "sanity + eleventy + netlify".
I followed the very basic guide from:
https://www.sanity.io/create (did not cloned or messed with any code yet).Connected my Github and Netlify
Accessed my "studio" on Netlify
Added a new "test post" and hit "Publish"
The new post never showed up
The "web" of my blog:
What am I missing?

(PS.: I have already deployed again the "web" and "studio")
Apr 10, 2021, 1:17 AM
Hi!I think that you need to trigger a rebuild of the website.
You need this plugin:
https://github.com/sanity-io/sanity-plugin-dashboard-widget-netlify Is is already included in the starter?
Apr 10, 2021, 6:44 AM
user E
The "deploy to Netlify" is already included in the starter.

I deploy my "web" again
Everything seems to be OK according to the Netlify log (including the changes I made)

9:47:56 AM: Writing _site/README/index.html from ./README.md.

9:47:56 AM: Writing _site/index.html from ./index.njk.

9:47:56 AM: Writing _site/posts/index.html from ./archive.njk.

9:47:56 AM: Writing _site/posts/picture-perfect-cropping-with-hotspots/index.html from ./post.njk.

9:47:56 AM: Writing _site/authors/nicholas/index.html from ./author.njk.

9:47:56 AM: Writing _site/posts/my-first-introduction-to-portable-text/index.html from ./post.njk.

9:47:56 AM: Writing _site/posts/finally-i-found-a-content-management-system-i-can-use-on-my-phone/index.html from ./post.njk.

9:47:56 AM: Writing _site/posts/exploration-powered-by-structured-content/index.html from ./post.njk.

9:47:56 AM: Writing _site/posts/my-brand-new-blog-powered-by-sanity-io-eleventy/index.html from ./post.njk.

9:47:56 AM: Benchmark (Data): 
./_data/authors.js` took 371ms (27.1%)`

9:47:56 AM: Benchmark (Data): 
./_data/metadata.js` took 236ms (17.3%)`

9:47:56 AM: Benchmark (Data): 
./_data/posts.js` took 241ms (17.6%)`

9:47:56 AM: Creating deploy upload records

9:47:56 AM: Processed 9 files in 1.28 seconds (v0.9.0)

But my post still not there.
Apr 10, 2021, 12:50 PM
If you look in /template/web/client-config.js, does the projectId fall back on the correct project ID? I wonder if it might not be picking up the env variable and is falling back on the project ID of the template.
Apr 10, 2021, 2:59 PM
user A
! I checked my
file and the
and it set properly "Project ID" provided by Sanity. I also redeployed both projects (studio / web) but I with no success with my new post.
Apr 11, 2021, 2:49 PM
user T
I set up this starter and managed to get it going by adding a category to my new post. I wish I could say that’s the answer, but since then I’ve been able to add other posts without categories and they show up too (after a deploy). 🤷‍♂️
Apr 12, 2021, 7:52 PM
user A
!You found it! Actually I tested and it is not related to the "category" but to the "Published at" field. It is required to fill it so Sanity do not "auto generate" it!
Tks a lot!
Apr 12, 2021, 8:42 PM
Ahh, that makes more sense. Awesome! Glad it’s working for you. :)
Apr 12, 2021, 8:43 PM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?