Global param published = private

Dear developers, users und fans of Hugo!

May I suggest the global param published = "private" (or similar) with these consequences:

  • exclude from sitemap.xml
  • exclude from any index.xml
  • exclude from any list and archives
  • exclude from tags view
  • exclude in robots.txt
  • change <meta content="index, follow" name="robots"> to <meta content="noindex, follow" name="robots">
  • warn if linked to from a site with published = true (maybe)
  • … (?)

Any other suggestions?

Of course, you could just establish a side project under a subdomain, but I would very much prefer the “private function”.

See this post.

Thank you all!

Your proposal would be easier to reason about if you said “include only in ???”.

Thank you, bep.

I’m not quite sure what you mean. Shall I rename the topic title?

Instead of programming many, many if queries, it could be easier to treat pages with published = "private" just like published = false.

After generating the complete public folder generate the private html pages and replace the robots meta. That’s all, I think.

Thanks once again.

No thhe title is fine, it is just much easier to understand the shortest list.

That’s very easy to do within your theme.

How exactly?

The partial can query the config and output the meta mentioned.

Well, it’s easy to exclude private pages e. g. from the sitemap. But excluding them from all items mentioned above is pretty confusing and error-prone if you adjust your web project regularly.

Overall, a private function could be a very welcome enhancement for many users.

Your proposal would be easier to reason about if you said “include only in ???”.

Ok: Build private pages, include in “nothing” and change robots meta.


1 Like