The Trans Directory
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Emile Bangma
Jacky Zhao
and committed by
GitHub
457b77dd 3ce6aa49

+4
+4
quartz/plugins/transformers/frontmatter.ts
··· 114 114 115 115 if (socialImage) data.socialImage = socialImage 116 116 117 + // Remove duplicate slugs 118 + const uniqueSlugs = [...new Set(allSlugs)] 119 + allSlugs.splice(0, allSlugs.length, ...uniqueSlugs) 120 + 117 121 // fill in frontmatter 118 122 file.data.frontmatter = data as QuartzPluginData["frontmatter"] 119 123 }