decap-cms icon indicating copy to clipboard operation
decap-cms copied to clipboard

Throw better error on duplicate frontmatter key

Open martinjagodic opened this issue 1 year ago • 6 comments

Is your feature request related to a problem? Please describe. Sometimes we commit frontmatter via git and it happens that we duplicate a key. This causes an error, but it's not clear at all what's the cause.

Describe the solution you'd like Show a better error: which key in which file is duplicated. Possibly propose a fix to delete the extra line. If the lines are different, offer which one to keep.

Describe alternatives you've considered If you somehow realize that keys are duplicated, you need to find and remove them, which can take some time.

Example

---
title: Example post
description: Hello world!
title: This second title causes an error 
---

martinjagodic avatar Aug 06 '24 12:08 martinjagodic

May I know is the issue resolved?

sampath24-ss avatar Oct 25 '24 18:10 sampath24-ss

I was very close in PR #7270 but I got sidetracked as this is not a top priority. I hope to get back to it soon

martinjagodic avatar Oct 26 '24 06:10 martinjagodic

Hey Can I give it a try ?

yash-dayama avatar Jul 31 '25 05:07 yash-dayama

hey can i help in contributing ?

codeafridi avatar Dec 07 '25 09:12 codeafridi

@codeafridi You can take over; some work has been done in #7270. You can continue this PR or start a new one.

martinjagodic avatar Dec 08 '25 08:12 martinjagodic

Thanks for assigning this to me! I’ll check #7270 and start working on it. I’ll push updates soon

codeafridi avatar Dec 08 '25 08:12 codeafridi