From af8e68ba6fd838527fcd868ee33a825b0e649933 Mon Sep 17 00:00:00 2001 From: Robbie Court Date: Mon, 22 Jun 2026 18:00:08 +0000 Subject: [PATCH] Fix invalid YAML front matter for terms with no tags A term with an empty Tags list still had its ID-prefix tag appended onto an empty CSV string, producing "tags: [,VFB]". The leading comma is an empty flow-sequence node, which go-yaml rejects ("did not find expected node content"), failing the Hugo build on VFB_00017893_v8.md. Build the tag list properly and drop empty entries before joining. --- vfbterms.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/vfbterms.py b/vfbterms.py index bf715d9..193eda7 100644 --- a/vfbterms.py +++ b/vfbterms.py @@ -497,11 +497,14 @@ def generate_page(term_data): url_slug = get_term_url(name, term_id) # Tags for front matter - tags_csv = ",".join(tags) + # Build a clean list and drop empties, otherwise a term with no Tags + # yields a leading comma (e.g. "[,VFB]") which is invalid YAML flow syntax + tag_list = list(tags) if "_" in term_id: - tags_csv += "," + term_id.split("_")[0] + tag_list.append(term_id.split("_")[0]) elif term_id.startswith("FB"): - tags_csv += "," + term_id[0:4] + tag_list.append(term_id[0:4]) + tags_csv = ",".join(t for t in tag_list if t) # Thumbnails thumbnails = get_thumbnails(term_data)