(filePath: string, slug: string[])
| 124 | } |
| 125 | |
| 126 | function readDocFile(filePath: string, slug: string[]): DocFile { |
| 127 | const raw = fs.readFileSync(filePath, "utf8"); |
| 128 | const { data: frontmatter, content } = matter(raw); |
| 129 | |
| 130 | const processed = preprocessMdx(content, slug); |
| 131 | |
| 132 | return { frontmatter, content: processed, slug }; |
| 133 | } |
| 134 | |
| 135 | /** |
| 136 | * Preprocess MDX content: |
no test coverage detected