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
750 stars 34 forks source link

Feature Request: Widget `compute` #111

Closed samtrion closed 4 months ago

samtrion commented 4 months ago

This widget is a read-only element that updates itself based on events (focus change, etc.). It should take over existing content and transform it if necessary.

The configuration for this could look as follows.

fields:
  - label: Slug
    name: slug
    widget: string
    i18n: duplicate
  - label: TranslationKey
    name: translationKey
    widget: compute
    value: posts-{{fields.slug}}
kyoshino commented 4 months ago

It’s probably not difficult to implement but I don’t want to think about circular reference handling 😅

samtrion commented 4 months ago

Well, there are solutions for that too, especially as the range of setting options is limited.

It also depends a little on the implementation of #17, so that you don't have to fish with dynamite to find the error.

kyoshino commented 4 months ago

Just shipped v0.13.0 to implement this and other features 🚀