Your ability to explain and deliver technical content is god sent... Thank you!
@fran_sar3 жыл бұрын
Woooow! You are fast. But to the point, concise and awesomely useful! Thanks!!!!
@julianehiem31183 жыл бұрын
You just gained another subscriber. This video is very timely for me. Thanks!
@vonvetur2 жыл бұрын
Just a small note: don't use divs as buttons (unless you actually add all the functionality and accessibility features to it). Even if you do not care about WCAG those links should be just tags. The ability to open it in the new tab, middle click on it, make it focusable, link preview in the browser etc.
@PortEXE2 жыл бұрын
Unless you specifically do not want any of that functionality.
@mahbubhasan15382 жыл бұрын
Nice explanation and your video save my time. Love from Bangladesh
@LeslieDuan3 жыл бұрын
Great work, sir! Exactly what I expected. Very concise, straightforward and clear!
@yassinabdulla368 Жыл бұрын
Thank you very much it helped very much it was exactly what I was looking for
@avroml3 жыл бұрын
Excellent content, thank you kindly, sir! Clear and simple. Used your explanations as inline comments - concise and on the object.
@alevratract8301 Жыл бұрын
Love the tutorial, thank you!!
@davidcarrillojr77833 жыл бұрын
This is fantastic content!! I am researching how I can start a KZbin channel with similar styled tutorial videos!!! Well Done!!!!
@TheMarcoDahms3 жыл бұрын
Outstanding tut. I finally know now how to get data from sanity into the frontend
@SkillyLuckington Жыл бұрын
Your Repos Deserve Way more stars :)
@thecasualistplays3 жыл бұрын
Zackery, I needed this so much! Thank you big time!
@PortEXE3 жыл бұрын
Glad it helped. I hope to see your blog when it's done!
@thecasualistplays3 жыл бұрын
@@PortEXE Thanks man! It did and I'll shoot you a tweet or something when I can get something up!
@louierichardson1233 жыл бұрын
Fancy seeing you here ;)
@corykelley33873 жыл бұрын
@@louierichardson123 🙌
@fixesdev Жыл бұрын
This is a great video! Thanks a lot
@LifeSurf1232 жыл бұрын
This was great! Really helpful and applicable. Do you have more videos expanding on this?
@mylesy40482 жыл бұрын
Great tutorial and you're straight to the point 👍🏽 ps. maybe we can use next/link for routing next time :)
@agengo12 жыл бұрын
Thank you so much your video is very helpful
@lowpedia70233 жыл бұрын
Very excellent, and straight-forward, thank you!
@maksymspaskyi95843 жыл бұрын
Very interesting! Looking forward your next videos.
@Play_Streams2 жыл бұрын
Good stuff, straight to the point!
@erayozaydin36363 жыл бұрын
if sanity init doesnt work in powershell etc, write this code Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass and it works
@valentinbenitobousquet61662 жыл бұрын
Great + great + great tutorial
@RonaldShin3 жыл бұрын
How do you deploy this to vercel? Since it has frontend and backend(sanity io) folder? Can you clarify this for me? I'm bit confused.
@dude101cool3 жыл бұрын
Thanks, dude, amazing tutorial
@AnthonyCandaele3 жыл бұрын
very helpfull tutorial. I'm planning to build my portfolio site with Next.js and Sanity, so I would love to see a portfolio on that.
@gabriellengoo85112 жыл бұрын
How would you uses imageUrl for arrays? ( ps This tutorial was amazing thank you! )
@ceramic9h3 жыл бұрын
Thank you for the tutorial Zackery. Is it possible if you could elaborate more on how to use getServerSideProps with SWR?
@teacher_med3 жыл бұрын
I really enjoyed this video thank you : )
@chriscrowd49463 жыл бұрын
Very well done! Thank you!
@yo14142 жыл бұрын
Very nice!
@usmanmunir15593 жыл бұрын
Cool content! Enjoyed
@filipevalentegomes23832 жыл бұрын
would have been nice to see how and where to deploy sanity, but great video
@rishabsharma53073 жыл бұрын
Great tutorial!
@faiyazrafeek26283 жыл бұрын
You just doing amazing, thank you :)
@ngamsomset3 жыл бұрын
very very good video. thanks!
@mertgenc98903 жыл бұрын
everything look great but why do you use windows instead of linux?
@PortEXE3 жыл бұрын
Linux isn’t a sufficient main OS for my needs. It has its niche uses though.
@mertgenc98903 жыл бұрын
@@PortEXE Yes I understood. If adobe programs are compatible with linux one day, I will not use windows anymore.
@Rahman.Shahadat2 жыл бұрын
Amazing
@Jawad_Siddiqui2 жыл бұрын
Thanks !!!
@Thororm3 жыл бұрын
Very good, thank you!
@Ryan-mx4ll2 жыл бұрын
Does it make a difference mapping the posts on a component instead of index? It works fine on index, but when I do the exact same thing in a component, it gives me an error saying posts.length is undefined (in useEffect)
@polypusdb9751 Жыл бұрын
Yes it does, you cannot use getServerSideProps in a component, it needs to be passed down from the page instead, or you can do a fetch request in the useEffect, but it would not be a good solution
@cazterk3 жыл бұрын
how do i limit the number of featured posts on the home page given I have a couple of them on the backend but just need a few to be displayed
@morrisrjc2 жыл бұрын
is the getStaticProps function used throughout this video the only way to fetch data from sanity in NextJS?
@gideonolaiya66652 жыл бұрын
No, you can also use getServerSideProps. But getStaticProps is used when you already have the data during build time(the time at when you are writing the code) getServerSideProps is used if you are getting data during fetch time, it's used for data that changes almost everytime.
@trongnhanle76582 жыл бұрын
how to create search functional with sanity
@darkamer38792 жыл бұрын
Can I host using Netlify.
@PortEXE2 жыл бұрын
You can if you set it up. Be sure to read the documentation to get an idea of what needs to be done.
@darkamer38792 жыл бұрын
Thank you so much
@edshav3 жыл бұрын
Hello, why are you using getServerSideProps for getting a single post, but not getStaticProps?
@PortEXE3 жыл бұрын
getStaticProps is only called at build time, meaning that if I update a blog post I would need to rebuild my app to see the changes. So it’s really just used for static site generation and not server side rendering like we want here.
@rishabsharma53073 жыл бұрын
@@PortEXE How about using Incremental static regeneration. We can pass a value to revalidate and by that next js can cache the result for certain period of time. And if we pass a value of 60 mins to revalidate then next js will hit the api after every 60 mins. That way, only 24 requests will be made to sanity cms which will ensure that we are always in our free tier of sanity.
@86thecake3 жыл бұрын
Wouldn't using the sanityClient be a lot easier than using a long URL?
@PortEXE3 жыл бұрын
It’s better for new comers to understand exactly what’s going on instead of always abstracting via libraries.
@86thecake3 жыл бұрын
@@PortEXE gotcha, thanks for the response! Subbed, your way of teaching is solid.
@amankrx3 жыл бұрын
How will we fetch author->name here.
@Codesey3 жыл бұрын
Cannot read property '0' of undefined. i am try your way for this problem but it did not work
@deadpatrices90743 жыл бұрын
Hi Codex, I had this problem for a while and in my case the error was caused by my forgetting the return in the else statement in file [slug].js' getServerSideProps function: if (!post) { return { notFound: true } } else { return {
@coops13483 жыл бұрын
dude great job, this helped me really get off the ground with levelling up my NextJS blog to implement Sanity, but please use semantic HTML like nav, section, article etc. It is really important we are demonstrating proper HTML usage
@grandpaonfire68342 жыл бұрын
why is that?
@MrDBH723 жыл бұрын
I am completely stuck at the 20 minute mark. I cannot find any of the props and therefore nothing is rendered other than 404. The URL is exactly as you have written, but it still does not work... I am an apprentice and relatively new to this. If anyone could help me with this issue, I would really appreciate it!
@avroml3 жыл бұрын
I was struggling with the same thing. I debugged it first by by double checking the project ID (the first part of the URL) and the dataset name ("production" is by default, but you might have created your own dataset in Sanity, so check it in the sanity studio codebase's sanity.json what are your own values of "api": {"projectId" and "dataset"} Good luck!
@furkandemirbilek71923 жыл бұрын
thank you :)
@ahnaafarafee3 жыл бұрын
Why are you using next/router instead of next/link ?
@PortEXE3 жыл бұрын
Preference
@rhmhr2 жыл бұрын
And if you want code input and highlighting to this project, check out: dev.to/hosenur/implementing-code-input-highlighting-in-next-js-sanity-blog-40he If you want to add tags to your posts, check out: blog.hosenur.dev/add-tags-to-your-sanity-io-articles
@eoincarrick78052 жыл бұрын
Please you should have focused on all 1:31,
@MilanDrazic3 жыл бұрын
I need this
@adamkenton25853 жыл бұрын
How would you deploy this ?
@PortEXE3 жыл бұрын
Check out my beginner Next.js tutorial. The deployment process here would be the same as in that video.
@adamkenton25853 жыл бұрын
@@PortEXE You mean "coding a news app..."
@PortEXE3 жыл бұрын
@@adamkenton2585 Yes. That one explains how to deploy a Next.js application. That same process can be applied here.
@adamkenton25853 жыл бұрын
@@PortEXE Gotcha ! thank you so much
@akimayenasouleamidou64493 жыл бұрын
I can't post since the loading spinner keeps spinning forever 😔
@akimayenasouleamidou64493 жыл бұрын
I can't understand why that doesn't work. Any idea please?
@DarnellSylvain3 жыл бұрын
My imagebuilder does nothing
@DarnellSylvain3 жыл бұрын
when I console.log it it doesnt change at all when put through the builder
@ahnaafarafee3 жыл бұрын
He just exposed his API key. Don't do it. Use .env files
@PortEXE3 жыл бұрын
I’ve got plenty of videos on that topic. Also I specifically mention not to expose it.
@muhammadmehdiali41722 жыл бұрын
Instead of using the imageUrlBuilder method from @sanity/image-url, you can update your query to have it send you the url of the image directly. Since the image is actually a reference, you can have it point to the reference then send the url. This can be done through: const query = encodeURIComponent(`*[_type == "post" && slug.current == "${slug}"]{ "imageUrl": mainImage.asset->url, title, slug.... etc. }`) Now your post variable from the GET request contains post.imageUrl that is the url of the image.
@arremayu3 жыл бұрын
Incase anyone getting error to add imgUrlBuilder then just pass it to url() function like this in useEffect hook::::--> setImageURL(imgBuilder.image(image).url());
@7taztoons2 жыл бұрын
Thanks , this comment need to be on top :) cc @PortEXE
@7taztoons2 жыл бұрын
if you have a problem with url img on the feed useEffect(() => { if (posts.length) { const imgBuilder = imageUrlBuilder({ projectId: "eb99jfco", dataset: "production", }) setMappedPosts( posts.map((post) => { return { ...post, mainImage: imgBuilder.image(post.mainImage).url(), } }) ) } else { setMappedPosts([]) } }, [posts])
@sjonny-depp3 жыл бұрын
3 things I notice is very weird 1. result.resut 2.DIV as a link and 3. passing INDEX as a key inside a map.. should never be a index value people should use a unique _ref ID.