commit
464ab08c69
@ -98,6 +98,10 @@ export async function getAllFilesFrontMatter(folder) {
|
||||
files.forEach((file) => {
|
||||
// Replace is needed to work on Windows
|
||||
const fileName = file.slice(prefixPaths.length + 1).replace(/\\/g, '/')
|
||||
// Remove Unexpected File
|
||||
if (path.extname(fileName) !== '.md' && path.extname(fileName) !== '.mdx') {
|
||||
return
|
||||
}
|
||||
const source = fs.readFileSync(file, 'utf8')
|
||||
const { data } = matter(source)
|
||||
if (data.draft !== true) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user