nextra icon indicating copy to clipboard operation
nextra copied to clipboard

[nextra-theme-blog] Allow for a draft post

Open rgoomar opened this issue 3 years ago • 2 comments

Currently, you can get around this by putting a _ as part of the .mdx file although, I think it would be helpful to have a metadata field like:

---
type: post
draft: true
---

That way, it won't display in the posts list although still have a link that you can send out to people to review that will remain the same after publishing.

rgoomar avatar Feb 01 '22 20:02 rgoomar

@rgoomar

you can get around this by putting a _ as part of the .mdx file although

Do you mind sharing more details on how to make it work? Thx!

t0t07 avatar Feb 02 '22 03:02 t0t07

@YikSanChan Basically, if you have an _ in the beginning of the filename, it ignores it based on this line https://github.com/shuding/nextra/blob/core/packages/nextra-theme-blog/src/index.tsx#L126

So you can link to it as a post, but doesn't appear in the list.

rgoomar avatar Feb 02 '22 03:02 rgoomar

It would be great if draft pages were also supported. Why to limit this only to posts? Also, I am using Docs theme for blogging, could this be ported to Docs theme too?

jiri-matejka avatar Sep 06 '23 09:09 jiri-matejka