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
905 stars 45 forks source link

Add support for gitea/forgejo backed #198

Open nakibrayan3 opened 1 month ago

nakibrayan3 commented 1 month ago

this is the only thing holding me back from switching to svelita-cms

kyoshino commented 1 month ago

As mentioned in the README, we have no plans to support Gitea/Forgejo at this time for performance reasons. Basically, there is no way to get multiple files at once, requiring 100 requests to fetch 100 files, which is a non-starter. We will reconsider it if/when their API improves in the future.

oliverpool commented 2 weeks ago

For anyone interested in implementing it on the Forgejo/Gitea side

The forge would need to expose an API allowing efficient implementation of the BackendService api:

https://github.com/sveltia/sveltia-cms/blob/a2b3773986b794eeb3035871cb6d4560eadf390d/src/lib/typedefs.js#L69-L93

I think the main challenge would be fetchFiles, which usually calls the common fetchAndParseFiles function, which call the forge-specific fetchFileList function, which must return the whole tree of files (path + sha):

https://github.com/sveltia/sveltia-cms/blob/a2b3773986b794eeb3035871cb6d4560eadf390d/src/lib/services/backends/gitlab.js#L342-L348

nakibrayan3 commented 2 weeks ago

I wish I had the experience to implement something like this.

kyoshino commented 2 weeks ago

Well, once Gitea/Forgejo is updated to provide a better API, I’m happy to implement it. I have seen discussions on the Forgejo forum, and oh, @oliverpool has left some comments there 🙂

kyoshino commented 2 weeks ago

Aside from Forgejo support, Sveltia CMS doesn’t yet support RTL, which is probably what @nakibrayan3 needs. Netlify/Decap CMS has an issue for this since 2019, and it’s also on my todo list, as Sveltia CMS has to offer first-class i18n support 😆 (and my native Japanese was also kinda RTL at some point in history.)

nakibrayan3 commented 2 weeks ago

Thanks to every one here helping :)

kyoshino commented 1 week ago

I’ll keep this open for future possibilities. #31 has an interesting idea, btw.