Skip to content

Commit 33f1bbf

Browse files
authored
fix: omit description if undefined (#11)
1 parent 10409b8 commit 33f1bbf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/runtime/server/routes/llms.txt.get.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ export default eventHandler(async (event) => {
2727
}
2828
document.push(
2929
section.links?.map((link) => {
30-
return `- [${link.title}](${link.href}): ${link.description}`
30+
return link.description
31+
? `- [${link.title}](${link.href}): ${link.description}`
32+
: `- [${link.title}](${link.href})`
3133
}).join('\n') || '',
3234
)
3335
}

0 commit comments

Comments
 (0)