-
-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for renaming entry files in collections #248
Comments
Support for renaming entry slugs/files is of course planned as first pinged by @CarloBu in #140 (comment). I already have a WIP branch, but have realized that it needs to take Relation fields into account. Basically the CMS has to do the same as Sveltia CMS already has support for renaming asset files with referencing entries updated, and I’ll implement the same for references between entries. But things are more complicated — required Relation fields should not be deleted, for example. Here are relevant Netlify/Decap CMS issues:
Decap CMS touts powerful Relation widgets, but it’s not powerful at all until these issues are solved. So my plan is to make Sveltia CMS more like a RDBMS, and it will be done before the 1.0 release (for marketing reasons) 🙂 |
That's great to hear. Right, the relation fields are definitely a concern. I wonder if handling the side-effects / cascade could be reasonably driven by a CMS event? E.g., you internally listen for a I'd also suggest that the An interesting feature — if you open PRs before you get to this I'd certainly assist. |
+1! |
@ryangittings Glad you have found Sveltia. I have already implemented your issue decaporg/decap-cms#7322 so enjoy! |
There are other ways to refer to this functionality — editable or customizable slugs being the most common — but the core of the feature is the ability to rename an existing file in a collection. There is a still open issue from 2017 on Decap CMS that gets into this sort of functionality and some of the attendant complexities, but to me the core of the issue boils down to this:
WIP-Post-About-A-Dog
. Havingwip-post-about-a-dog.md
forever in your repo is not ideal.The solution I propose would be as follows:
rename_files: boolean
.path
is generated and compared to the previous value on every save.path
has changed, "rename" the file (for both GitHub's API and the Filesystem API, I believe this is a delete + create).path
in some fashion in the event payload.I realize this is almost certainly a post-v1 concern.
The text was updated successfully, but these errors were encountered: