Skip to content
Permalink
Browse files
404 posts that should be unpublished
  • Loading branch information
Jesse Chen committed Mar 13, 2023
1 parent ea3e0f0 commit 3e40ba3
Showing 1 changed file with 6 additions and 0 deletions.
@@ -70,6 +70,12 @@ export const getStaticProps = async ({ params }) => {
const source = fs.readFileSync(postFilePath)

const { content, data } = matter(source)

if (!data.isPublished) {
return {
notFound: true,
}
}

data.readingTime = require('reading-time')(content)

1 comment on commit 3e40ba3

@vercel
Copy link

@vercel vercel bot commented on 3e40ba3 Mar 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.