sveltia / sveltia-cms

Alternative to Netlify/Decap CMS. Fast, lightweight, Git-based headless CMS. Modern UX, first-class i18n support, open source & free. Made with Svelte.
MIT License
862 stars 43 forks source link

[Feature Request] Option to disable local backend (filesystem) when developing locally #173

Closed dallyh closed 3 months ago

dallyh commented 3 months ago

Hello, I would like to simply disable the local backend when testing live previews of a site, and also to test automatic deployments etc while running the live site preview. I've searched through the source code, and this is currently possible but with workarounds, because local backend is getting detected by the localhost URL: https://github.com/sveltia/sveltia-cms/blob/51f56d7803ed426bd0e0cc487a649e9c7ffc4e20/src/lib/services/user.js#L77-L85

Thanks!

PS. I hope I've pointed to the correct code :)

kyoshino commented 3 months ago

You mean, you’d like to use a remote backend from the local instance? There is a manual workaround for it:

  1. Open the browser’s DevTools
  2. Open the Application tab (in Chrome) or Storage tab (in Firefox)
  3. Create a new local storage item: key: sveltia-cms.user, value: {"backendName":"github"}

This allows you to sign in to GitHub. If it doesn’t work,

  1. Sign in to the remote instance
  2. Open the browser’s DevTools
  3. Copy the sveltia-cms.user local storage value with an API token
  4. Go back to the local instance
  5. Open the browser’s DevTools
  6. Create a new local storage item: key: sveltia-cms.user, value: (copied value)

Well, so I think Sveltia CMS should provide 2 options on the sign in page, Local or GitHub, so you don’t have to do this manually 🙂

You can disable automatic deployments with the backend config.

kyoshino commented 3 months ago

The fix shipped with v0.35.0 🚢