Filter non md files

This commit is contained in:
LordMathis 2019-10-13 18:33:44 +02:00
parent 8cf973be70
commit f6fef99648
No known key found for this signature in database
GPG Key ID: 575849FD91CE470C
2 changed files with 5 additions and 1 deletions

View File

@ -3,4 +3,5 @@ npm-debug.log
yarn-error.log yarn-error.log
build build
public public
content
.git .git

View File

@ -103,7 +103,10 @@ export class Scanner {
.then( .then(
(files) => { (files) => {
const filtered = files.filter( const filtered = files.filter(
(file) => fs.statSync(path.join(process.cwd(), config.contentPath, file)).isFile() (file) => (
fs.statSync(path.join(process.cwd(), config.contentPath, file)).isFile() &&
path.extname(file) == '.md'
)
) )
return Promise.all(filtered.map(this.readfile)) return Promise.all(filtered.map(this.readfile))
} }