You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
With FrontmatterNaming.AsIs, merging still renames a lone list property to its canonical key (e.g. section: list becomes categories:) #147
In Frontmatter/PropertyMerger.cs, a group of keys that share one canonical name is written back in one of two ways:
Scalar values keep the original key: target[originalKeys[0]] = firstValue (around line 165).
List values go through MergeArrayValues, which always writes target[canonicalKey] = ... (around line 189). This happens even when the group has only one key and nothing is merged.
So list properties get renamed during merging, whatever FrontmatterNaming the caller asked for. Renaming is meant to be NameStandardizer's job, and FrontmatterNaming.AsIs is meant to turn it off.
Actual: the output header contains categories: [news].
Same document with section: news (a scalar): the key stays section.
Expected: with AsIs naming, a key that isn't merged with anything keeps its name.
This matters for site generators where the key name has its own meaning. Hugo's section is one example. Content can silently move to a different taxonomy. keywords becomes tags and category becomes categories the same way.
I reproduced this with an MSTest test against the current main.
Suggested fix / acceptance criteria
When originalKeys.Count == 1, copy the key and value through unchanged, the same as the scalar branch does.
When several list-valued keys really are merged, decide on one target key and use it consistently. Either use originalKeys[0] to match the scalar branch, or use the canonical key only when naming is not AsIs.
Add a test: a lone list property with AsIs naming keeps its key under every merge strategy.
Priority: Medium. FrontmatterNaming.AsIs is ignored for list-valued keys, so content can silently move to a different taxonomy (section→categories, keywords→tags). It is limited to list values and a straightforward fix.
Area / suggested assignee: property merging, PropertyMerger.cs (MergeArrayValues). Owner: @matt-edmondson
Duplicates / in progress: no duplicate. Open PR Keep repeated items within a list when merging properties #144 ("Keep repeated items within a list when merging properties") edits the same list-merge code. Land it first, or fix this on top of it, to avoid conflicts.
Next step: pass a lone list key through unchanged, choose one consistent target key when several keys are merged, and add the AsIs test for every merge strategy.
Activity
matt-edmondson commentedon Sep 27, 2026
Triage
FrontmatterNaming.AsIsis ignored for list-valued keys, so content can silently move to a different taxonomy (section→categories,keywords→tags). It is limited to list values and a straightforward fix.PropertyMerger.cs(MergeArrayValues). Owner: @matt-edmondsonGenerated by Claude Code