How to publish and "hide" drafts?

Hi!

I’m new to Hugo and could not figure out how to do the following.

I create a draft post (draft = true) and would like it to be published so that I can share the post URL with reviewers, but I would like the post to not appear in my blog homepage index.html.

I was able to create the draft post and publish it but don’t know how to hide it from the homepage.

Is that possible?

Thanks!

Yes, you should be able to build your site with -D and hide it with a query filter in the where clause in the main homepage template. I might consider using a custom flag (preview=true) or something for that, maybe … Not sure.

Thanks bep!

For the time being I’ve just manually removed the draft entry from the generated index.html.

how can we get that custom flag to work?

Hi,

I am closing this thread as you are replying to a 5-year old topic. Please read Requesting Help