Skip to content
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

Throw better error on duplicate frontmatter key #7262

Open
martinjagodic opened this issue Aug 6, 2024 · 2 comments · May be fixed by #7270
Open

Throw better error on duplicate frontmatter key #7262

martinjagodic opened this issue Aug 6, 2024 · 2 comments · May be fixed by #7270

Comments

@martinjagodic
Copy link
Member

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 
---
@sampath24-ss
Copy link

May I know is the issue resolved?

@martinjagodic
Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants