Datocms gatsby cloud preview

Is there a way to set up the gatsby cloud preview plugin, for the model having the slug stored on the text field?

Actually, we have slugs are stored in the text field instead of SEO slug field.

Note: I am talking about the plugin https://www.datocms.com/marketplace/plugins/i/datocms-plugin-gatsby-cloud

Maybe a similar question - It seems like the plugin just goes to broken URLs for records in nested directories instead of the expected. Is there a way to pass the model archetype as part of the url that the preview plugin can inject?

https:example.com/post/24-ways-to-Mars —> expected / desired

https://example.com/24-ways-to-Mars —> what the plugin outputs

Regarding the plugin on the slug field, you can manage a custom version of the plugin if you want. You can change the logic around here: https://github.com/gatsby-inc/datocms-plugin-gatsby-cloud/blob/master/src/Main.jsx#L41

And instead for the second question, we don’t manage the “nested directories” in DatoCMS, it’s something that you should take care of in your Gatsby code, OK?

1 Like

Thanks @mat_jack1. I’m using the Gatsby Dato CMS starter template that leverages the File System Route API instead of creating pages through gatsby-node.js. It creates pages inside of a post directory already. How would I go about making it work with the plugin via the gatsby code so that the plugin discovers the post directory? image

Nevermind? It seems to be working as expected now. Maybe because I fixed my preview webhook :slight_smile:

1 Like

Hi @mat_jack1

Thanks for the suggestion on making a custom plugin. Unfortunately, I am not familiar with making and hosting custom plugins. Is anybody from your team can help to modify the same gatsby source plugin to work with slug text field as well?

@s.verna I have seen it git that, you have worked on this gatsby source plugin. Will you be able to modify this plug-in to work with the slug text field or Can you guide me on how to customize this plugin and use it?

unfortunately @saran we don’t do these sort of customisations, but you can have a look at our guide: https://www.datocms.com/docs/building-plugins to do that.

We are planning to add a partner program soon on DatoCMS so that you could be in touch with selected partners that could help you. But I don’t have an ETA for that, sorry :frowning:

@mat_jack1I managed to make new plugin to suit my requirement. Below is the plugin URL. Posting here so that it may help someone

1 Like