Are Build Options surfaced as Page Variables?

Are Build Options like list and render surfaced as Page Variables?

A use case would be where list: 'never' is set in the Front Matter for a page – then a template could read the associated page property and use it to also remove the page from being indexed by a third-party indexer.

Alternatively, this could likely be done by setting a user-defined parameter as well, but since the build option is already set, it would be nice to be able to use it.

If you explicitly set the values in a page’s front matter, you can retrieve them with:

{{ .Params._build.list }}
{{ .Params._build.render }}

To get a pretty view of the page’s .Params:

<pre>{{ jsonify (dict "indent" "  ") .Params }}</pre>

The build options are not available in .Params if they are implicitly set via cascade at a higher level (e.g., section, site config).

1 Like

Awesome, thank you @jmooring — if that was in the docs I completely missed it!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.