mirror of
https://github.com/hanzo-docs/docs.git
synced 2026-10-25 04:20:02 +00:00
OpenAPI: handle undefined description in index.md generation (#2380)
* OpenAPI: handle undefined description in index.md generation * Create chilled-bikes-think.md --------- Co-authored-by: Fuma Nama <[email protected]>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"fumadocs-openapi": patch
|
||||
---
|
||||
|
||||
OpenAPI: handle undefined description in index.md generation
|
||||
@@ -481,8 +481,9 @@ function writeIndexFiles(context: HookContext, options: Config) {
|
||||
const { data } = matter(file.content);
|
||||
if (typeof data.title !== 'string') continue;
|
||||
|
||||
const descriptionAttr = data.description ? `description=${JSON.stringify(data.description)} ` : '';
|
||||
content.push(
|
||||
`<Card href="${urlFn(file.path)}" title=${JSON.stringify(data.title)} description=${JSON.stringify(data.description)} />`,
|
||||
`<Card href="${urlFn(file.path)}" title=${JSON.stringify(data.title)} ${descriptionAttr}/>`,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user