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

[Question/Request] Custom Page On Admin Panel #180

Open kjellherzke opened 2 months ago

kjellherzke commented 2 months ago

Hi! I recently came across sveltia-cms when searching for a better alternative to decap cms and I am very satisfied with this decision.

Nevertheless, one main reason for me to switch was the difficulty of developing an extension, mainly to the cms's ui. More specifically, my objective is to be able to add custom pages to the sveltia-cms's admin dashboard/ui, but I am wondering about which way of implementation.

I could fork this repository and modify the source code directly, but I would like to know if there is any other way of doing so that you would suggest me instead? Furthermore, I would be interested in knowing whether or not you are (natively) supporting custom pages?

For instance, I noticed that static-cms does offer that by default: Demo.

kyoshino commented 2 months ago

Hey @kjellherzke, thanks for checking out Sveltia CMS! It’s a good idea to have handy custom pages on the CMS. But I think I can work on it soonish, as Static CMS compatibility is planned after the 1.0 release, hopefully early next year.

Technically speaking, I need to figure out how to integrate React with Svelte-based Sveltia CMS, which is also required for custom widgets. Alternatively, I could just add support for pages inside iframes.

Anyway, I’ll put this on my todo list!

kjellherzke commented 2 months ago

Hey @kyoshino, I do understand that. Nevertheless I am questioning why you wouldn't want to primarily focus on Svelte-based extensions (mainly due to a more uniform code, and as this might be easier to implement), though I looked at this static cms documentation, showcasing the React component extension of static-cms.

This ability to extend the cms would be essential and crucial for my current projects. I would be pleased to see progress on this in the feature and I would like to participate in its development, if you would acknowledge.

Personally, the final idea for me is that the cms shall actually rather be part of an admin dashboard, then all of its content, if you understand me correctly. Although the cms is of course the actual provider of the admin ui, it should be extendible.

Another question (regarding the local development of sveltia-cms, not the deployment/production): Could you provide information on how to contribute/setting up a clone? Because when I clone, install dependencies and run the development build, I receive an error during the "Site configuration is loading" process:

Error: The configuration file could not be retrieved.
    fetchSiteConfig config.js:58
Caused by: TypeError: NetworkError when attempting to fetch resource.
 TypeError: NetworkError when attempting to fetch resource. config.js:168:12
    initSiteConfig config.js:168

I suppose I have to create a config.yml but do not really see where to place it...

Cheers!

kyoshino commented 2 months ago

Integrating Svelte is rather hard, because the code has to be compiled. Compiling Svelte code on the fly is possible, but it’s a heavy process. I’m instead thinking about supporting Preact+HTM as I said somewhere else, which is easier to develop and run without a build process. And for backward compatibility with Netlify/Decap CMS, I need to implement React integration anyway.

I’ll prepare developer docs after 1.0, because Sveltia CMS currently does not accept pull requests and I haven’t implemented the Test backend yet. That said, here’s what I’m doing to develop Sveltia CMS:

  1. Run Sveltia CMS with pnpm dev on localhost:5173.
  2. Run a SvelteKit site project with a Sveltia CMS configuration on localhost:5174.
  3. Open localhost:5173 in your browser.
  4. Work with a local repository.

If you’re using a framework other than SvelteKit, you need to specify the site URL with the VITE_SITE_URL environment variable. You may also need to set up CORS. Here is an example for e11y.

kyoshino commented 2 months ago

And I forgot to say: at this time, it’s possible to embed Sveltia CMS within your project using a custom mount element instead of embedding a custom page in the CMS.

kjellherzke commented 2 months ago

Great to hear, thank you very much for your replies.

Personally, I guess I am going to try out and develop an extendable version of sveltia-cms, that fits my 'vision'. And if it works and looks good, I may inform you, if you insist.

kyoshino commented 2 months ago

By the way, Sveltia CMS is currently migrating to Svelte 5. It’s a massive rewrite with over 2,500 lines of changes. If you want to extend the CMS, you might want to wait until it’s done next month.

kyoshino commented 1 month ago

Static CMS is dead as of today 😢 The documentation is archived at https://staticjscms.netlify.app/docs/additional-links

CarloBu commented 1 month ago

Static CMS is dead as of today 😢 The documentation is archived at https://staticjscms.netlify.app/docs/additional-links

yeah, I saw in the discord the message. I didn't use it personally, but it's sad that there are one less git-based cms.

kyoshino commented 1 month ago

I’ve also never used it for my projects, but they did great job IMO. I like their documentation.

BTW do you want me to create a Discord server? Here we go: https://discord.gg/6zC5eTCw 🦀

CarloBu commented 1 month ago

I’ve also never used it for my projects, but they did great job IMO. I like their documentation.

BTW do you want me to create a Discord server? Here we go: https://discord.gg/6zC5eTCw 🦀

yeah, it's sad... now you can steal their documentation 🫣

new discord. noice!

RDjarbeng commented 1 week ago

Is the discord limited to those invited only?

kyoshino commented 1 week ago

It has expired by mistake. A new invitation link is https://discord.gg/5hwCGqup5b

RDjarbeng commented 1 week ago

Thanks, joined now