Back to blog

Gatsby Image support and Unpublish later

Jazib Sawar's avatar

Jazib Sawar

February 17, 2020

cover image

We're happy to announce the support of Gatsby Image in the Cosmic source plugin. The update enables you to utilize Gatsby’s native image processing capabilities to optimize image loading for your sites. In addition to that, we've also released a feature that allows content creators to unpublish content automatically at a later date and time.

1. Gatsby Image Plugin Support

What you need to know
There are no breaking changes, the Gatsby source plugin now has a next tag which you can use to test the new integration.
Get the new code
Download an example

The updates
Before this release, you didn't have the ability to use the awesome Gatsby Image plugin along with the Cosmic source plugin. But with this release, you now have the option to download selected media from Cosmic to save and cache locally. It will then use Gatsby’s native image processing capabilities with advanced image loading techniques to easily optimize image loading for your sites. 

You can install the plugin using  npm i gatsby-source-cosmicjs@next

Documentation is available here. You can also check our Gatsby Blog example here to look at the usage.

You can now do queries like this:

Note: It is in beta so your feedback is very important!

2. Unpublish Later

What you need to know
We had to simplify the layout of the publishing scheduler. If you were already using the publish later feature, you can see the video below to get an idea of what has changed.

The updates
We now provide the ability to unpublish your Objects at a specific day and time in the future. See the video below for details on how to set both scheduled "Publish" and "Unpublish" times. Minute increments have been changed from 15 minute to 5 minute increments to give you even more control of when your content is published and unpublished. To check this out, login and go to any Object in your Bucket. Then click the calendar icon connected to the "Publish" button.

We hope you enjoy these new features and updates. Any questions or comments? Reach out to us on Twitter and join the conversation on our Slack channel.