1
0
mirror of synced 2025-12-19 18:10:59 -05:00

Convert more files to TypeScript sync.js & find-page.js (#51775)

This commit is contained in:
Evan Bonsignori
2024-07-29 14:18:44 -07:00
committed by GitHub
parent a54bfeb700
commit 5038ef5a4e
21 changed files with 241 additions and 148 deletions

View File

@@ -310,6 +310,10 @@ async function getIndexFileVersions(directory, files) {
`File ${filepath} does not exist while assembling directory index.md files to create parent version.`,
)
}
// If not a markdown(x) file, skip it
if (!file.endsWith('.md') && !file.endsWith('.mdx')) {
return
}
const { data } = matter(await readFile(filepath, 'utf-8'))
if (!data || !data.versions) {
throw new Error(`Frontmatter in ${filepath} does not contain versions.`)