Emile Bangma
2025-03-22 457b77dd485f08616bd597492cdc26ed89ae92d3
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>
1 files modified
4 ■■■■ changed files
quartz/plugins/transformers/frontmatter.ts 4 ●●●● patch | view | raw | blame | history
quartz/plugins/transformers/frontmatter.ts
@@ -114,6 +114,10 @@
            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"]
          }