ainc / ainc-gatsby-sanity

Ainc Sanity Gatsby
3 stars 2 forks source link

Blog body data type on Sanity #239

Open ethangambles opened 8 months ago

ethangambles commented 8 months ago

The current blog body is type 'markdown'. This does not make it easy to include images within the blog content. It might be good to switch it over to the same type as the 'notes' body type.

LKRamen commented 2 months ago

Query for getting one blog post's content(change that [0] to [0..14] to get 15 items):

*[_type == "blog"]{body}[0]

LKRamen commented 1 month ago

For the next person to take this project:

The following link is an excellent resource for undergoing the actual process of converting markdown to portable text, HOWEVER as far as I know we don't have the markdown files in .md files which is how this resource tells you to get the blog content. The current script I have uses graphql to get the content, but graphql will only load info when we run 'npm run dev' and whenever I try to 'run dev' I've been having dependency problems. I'd recommend, instead, using the scripts for transferring sanity content that is in the 'emerging-entrepreneur-data-transfer' branch of the ainc-gatsby-sanity. Once you can implement the methods for importing data you can test out converting the data from markdown to portable text using the previously mentioned link.