From 07f0e79e20aaf6250cf111a410aed149d92d6609 Mon Sep 17 00:00:00 2001 From: thuanbui Date: Thu, 12 Mar 2026 14:04:33 +0900 Subject: [PATCH] fix: prevent overwriting existing frontmatter fields with custom taxonomy slugs --- src/parser.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/parser.js b/src/parser.js index a166e70..9a2b5bb 100644 --- a/src/parser.js +++ b/src/parser.js @@ -226,6 +226,10 @@ function populateFrontmatter(posts) { // inject custom taxonomy slugs into frontmatter, each taxonomy as its own field Object.entries(post.customTaxonomies).forEach(([domain, slugs]) => { if (slugs.length > 0) { + if (post.frontmatter.hasOwnProperty(domain)) { + console.warn(`⚠️ Skipping custom taxonomy '${domain}' on post '${post.slug}' because it conflicts with an existing frontmatter field.`); + return; + } post.frontmatter[domain] = slugs; } });