datocms / plugins

Repository providing samples using the Plugins SDK
MIT License
33 stars 47 forks source link

Update README.md with SvelteKit 2 web preview example #104

Closed matteodem closed 7 months ago

matteodem commented 7 months ago

Do you have an example of a /api/start-preview-mode route that renders a preview mode? Seems to be missing in the docs.

stefanoverna commented 7 months ago

It really depends on the frontend framework you're using. This is an example for Next.js: https://www.datocms.com/docs/next-js/setting-up-next-js-draft-mode

matteodem commented 7 months ago

Do you have an example with svelte? Thanks for merging btw

stefanoverna commented 7 months ago

We do! https://github.com/datocms/sveltekit-demo/blob/main/src/routes/enable-preview/%2Bserver.ts

matteodem commented 7 months ago

Thanks, but that doesn't work with web previews. I need the draft mode on a specific route without redirects. Do you have an example for that?

stefanoverna commented 7 months ago

@sistrall do we have anything ready?

sistrall commented 7 months ago

@matteodem we don't have anything ready at the moment, I'm sorry.