fix(frontmatter): prevent slug duplication through frontmatter (#1860)
* fix(frontmatter): prevent slug duplication through frontmatter
* Simplify duplicate slug checks
* Update quartz/plugins/transformers/frontmatter.ts
Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>
* lint
---------
Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>
| | |
| | | |
| | | if (socialImage) data.socialImage = socialImage |
| | | |
| | | // Remove duplicate slugs |
| | | const uniqueSlugs = [...new Set(allSlugs)] |
| | | allSlugs.splice(0, allSlugs.length, ...uniqueSlugs) |
| | | |
| | | // fill in frontmatter |
| | | file.data.frontmatter = data as QuartzPluginData["frontmatter"] |
| | | } |