Build with Sanity MCP in Replit. Prizes up for grabs! Submit by June 14

sanity-plugin-timelinejs

Studio v2
This plugin only works with an older version of Sanity Studio (v2), which is deprecated.

This plugin install schemas for hosting content for Timeline.js.

By Knut Melvær

v2 install command (deprecated)

sanity install timelinejs

Sanity Timeline.js schemas

sanity install timelinejs

This plugin install schemas for hosting content for Timeline.js. A simple example frontend can be found at codesandbox.io.

Simple GROQ formatting in order to get the correct content structure:

*[_type == "timeline"][0]{
  "title": title{
    "media": media{
      "url": asset->url,
        caption,
        credit
    },
    "text": title{
      headline,
      "text": text[][0].children[][0].text
    }
  },
  events[]->{
    "media": media{
      caption,
      credit,
      "url": image.asset->url
    },
    start_date,
    "text": text{
      headline,
      "text": text[][0].children[][0].text
    }
  }
}

Related contributions