Dynamically disable page generation from variable?

is there any way to disable page generation based on a variable value?

for instance, if i have only 1 author, can i disable generating an authors page (that’s already made) until i have at least 2 authors, but doing so without having to remember to change any config settings?

it doesn’t seem like this is possible, based on the precedence of how pages are generated (front matter, liquid, markdown, pages), but maybe someone has found a workaround?

The page will always be generated but you don’t have to link to it. When listing pages or posts in a menu you can filter to only those with so many authors

1 Like

yup, that’s what i’m doing now, all links are being removed to the page. i’m also wrapping the content of the page (but not the page itself) so that it isn’t rendered, based on a variable value. not ideal, but ok for now.

If you’re used to plugins you could write one which ignores a page if it is say type post and has fewer than 2 authors.

thanks, i may look into writing a simple plugin for this, but i was hoping to find an existing solution before going down that route.