feat(core): add configurable slug collision policy - #7992
Open
ryanvilbrandt wants to merge 1 commit into
Open
Conversation
✅ Deploy Preview for decap-cms ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
2 tasks
Author
|
Hello Decap team! 👋 I want to say that I love your CMS, and I'm excited to integrate it into my own project. I'm running into minor issues with that process, and I hope to be able to resolve them and also contribute beneficially to upstream in the process with my PRs. I'm happy to work with you to make sure my work meets your standards of quality, for this PR and ones I'll be putting up in the near future. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a
slug_collisionoption for folder collections that controls how Decap CMS handles a generated slug that already belongs to another entry.suffixpreserves the existing behavior and remains the default.rejectstops the save and reports the conflicting entry path.This lets projects whose content structure requires unique generated paths reject collisions without changing behavior for existing configurations.
This implementation accompanies decaporg/decap-website#173
Test plan
corepack pnpm run test(1,390 tests passed; 2 suites skipped)corepack pnpm exec jest packages/decap-cms-core/src/__tests__/backend.spec.js packages/decap-cms-core/src/constants/__tests__/configSchema.spec.js --runInBand(106 tests passed)corepack pnpm --filter decap-cms buildChecklist