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:
+2
-1
@@ -1128,7 +1128,8 @@ export default function (eleventyConfig) {
|
|||||||
const key = String(url).replace(/\/$/, "");
|
const key = String(url).replace(/\/$/, "");
|
||||||
if (!seen.has(key)) { seen.add(key); result.push(String(url)); }
|
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 {
|
try {
|
||||||
const content = readFileSync(inputPath, "utf-8");
|
const content = readFileSync(inputPath, "utf-8");
|
||||||
const escaped = siteUrl.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
const escaped = siteUrl.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
||||||
|
|||||||
Reference in New Issue
Block a user