Deprecations in v0.156.0

Regarding .Site.BuildDrafts, the “odd construct” note refers to the fact that this method exists only to report whether you started Hugo with the --buildDrafts flag.

The --buildDrafts flag is an instruction to “include content marked as draft.” In Hugo, “content” means Pages. Using a flag meant for filtering pages to show or hide other parts of your templates was never an intended use case, and we have no plans to include a direct replacement for it in the new API. While we could have moved this to hugo.BuildDrafts, we chose not to because its utility is extremely limited; logic for draft status is properly handled at the page level via .Page.Draft.

As I noted in the discussion you linked, the visibility of menu entries that reference pages with the pageRef property should be controlled by checking for the existence of the page itself… draft pages don’t exist.

If you need to show or hide other elements in your layout, using the environment or a custom parameter is the idiomatic approach. And remember that you can pass custom parameters on the command line, for example:

HUGO_PARAMS_FOO=bar hugo

Then access the value with .Site.Params.foo.

Regarding .Site.Languages, if you need a project-wide list of languages for a language switcher that includes every language even when a specific page translation does not exist, you should range over the slice returned by hugo.Sites.

Each site in that collection gives you access to its respective .Language and its own .Home page for a fallback link.