The Trans Directory
0
fork

Configure Feed

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

fix: more robust tags parsing

+12 -4
+12 -4
quartz/plugins/transformers/frontmatter.ts
··· 49 49 data.title = file.stem ?? "Untitled" 50 50 } 51 51 52 - if (data.tags && !Array.isArray(data.tags)) { 52 + if (data.tags) { 53 + // coerce to array 54 + if (!Array.isArray(data.tags)) { 55 + data.tags = data.tags 56 + .toString() 57 + .split(oneLineTagDelim) 58 + .map((tag: string) => tag.trim()) 59 + } 60 + 61 + // remove all non-string tags 53 62 data.tags = data.tags 54 - .toString() 55 - .split(oneLineTagDelim) 56 - .map((tag: string) => tag.trim()) 63 + .filter((tag: unknown) => typeof tag === "string" || typeof tag === "number") 64 + .map((tag: string | number) => tag.toString()) 57 65 } 58 66 59 67 // slug them all!!