Closed immortalrover closed 3 months ago
Sorry for the late reply, but there's no status
field in Blog as you correctly pointed out. It's just a draft
boolean variable. To hide it set draft: true
in the frontmatter.
You could try deleting the .contentlayer
generated folder and re-generating it again.
Thank you for your response. I have found a solution to the problem, and it has been resolved. I appreciate your assistance.
Describe the bug Hello, I've encountered an issue where blog posts marked as 'draft' are still appearing on the homepage.
Additional context I found that the type definition for blog post status in
.contentlayer/generated/types.d.ts
is set to:However, in the
contentlayer.config.ts
file, the status is set differently:To resolve this issue temporarily, I added a .filter function to each sortPost function in the part where allPosts are processed, specifically filtering out posts marked as 'draft'.
Could someone please help clarify if this is an intended behavior or a configuration mismatch? Additionally, if there are recommended practices for handling post statuses in this framework, I would appreciate guidance on the same.