fix: normalize related to array in seeAlsoLinks filter

Indiekit stores a single related URL as a plain string, not a YAML list.
Iterating over a string yields characters, breaking the See Also section.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
svemagie
2026-03-23 18:53:41 +01:00
parent 55c45ca168
commit 76a13c4441
+2 -1
View File
@@ -1128,7 +1128,8 @@ export default function (eleventyConfig) {
const key = String(url).replace(/\/$/, "");
if (!seen.has(key)) { seen.add(key); result.push(String(url)); }
};
for (const url of (relatedUrls || [])) add(url);
const relArray = !relatedUrls ? [] : Array.isArray(relatedUrls) ? relatedUrls : [relatedUrls];
for (const url of relArray) add(url);
try {
const content = readFileSync(inputPath, "utf-8");
const escaped = siteUrl.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");