|
|
@ -4,6 +4,7 @@ const fs = require('fs-extra')
|
|
|
|
const path = require('path')
|
|
|
|
const path = require('path')
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = { getPosts:async()=>{
|
|
|
|
module.exports = { getPosts:async()=>{
|
|
|
|
|
|
|
|
try {
|
|
|
|
let paths = await getPostMDFilePaths()
|
|
|
|
let paths = await getPostMDFilePaths()
|
|
|
|
let posts = await Promise.all(
|
|
|
|
let posts = await Promise.all(
|
|
|
|
paths.map(async (item) => {
|
|
|
|
paths.map(async (item) => {
|
|
|
@ -21,6 +22,10 @@ module.exports = { getPosts:async()=>{
|
|
|
|
)
|
|
|
|
)
|
|
|
|
posts.sort(_compareDate)
|
|
|
|
posts.sort(_compareDate)
|
|
|
|
return posts
|
|
|
|
return posts
|
|
|
|
|
|
|
|
} catch (error) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
} }
|
|
|
|
} }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|