tinymachine-sides / aiello-portfolio-site-sanity

Portfolio website of Andrew Aiello
https://www.drewaiello.com
0 stars 0 forks source link

Switch from local data to Sanity #3

Open tinymachine opened 2 months ago

tinymachine commented 2 months ago
tinymachine commented 1 month ago

Reel query:

*[_type=="reel"][0]

or (with image dereferenced)


*[_type=="reel"][0] {
  ...,
  placeholderStills[]{
    ...,
    asset->
  }
}

Settings query:

*[_type=="settings"][0] {
  ...,
  projectSets[]->
}

About query:

*[_type=="about"][0]

or (with image dereferenced)

*[_type=="about"][0] {
  ...,
  image{
    ...,
    asset->
  }
}

Project sets query:

*[_type=="project"][] {
  ...,
  projectSet->,
  featuredStill {
    ...,
    asset->
  },
  stills[] {
    ...,
    asset->
  }
}
tinymachine commented 1 month ago

Reference GROQ from my other project that you can modify:

  *[_type == "household" && isActive] {
      ...,
      photo != null => { "photo": {
        ...photo,
        "dimensions": photo.asset->metadata.dimensions,
        "url": photo.asset->url,
      }}
    } | order(primarySurname asc, primaryAdultFirstNames asc)