Skip to content

Commit

Permalink
fix: filter draft folder during build
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Won committed Sep 17, 2020
1 parent b37b5c7 commit b84aedb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/lib/posts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@ export function getSortedPostsData(): ISortedPostData {
}

export function getAllPostIds() {
const fileNames = fs.readdirSync(postsDirectory);

const fileNames = fs
.readdirSync(postsDirectory)
.filter((item) => (item === 'drafts' ? null : item));
return fileNames.map((fileName) => {
return {
params: {
Expand Down

0 comments on commit b84aedb

Please sign in to comment.